| 1627 | } |
| 1628 | |
| 1629 | void load_device_id( |
| 1630 | LiteDeviceType device_type, int device_id, const std::string& model_path) { |
| 1631 | lite::Config config; |
| 1632 | config.device_type = device_type; |
| 1633 | auto network = std::make_shared<lite::Network>(config); |
| 1634 | network->set_device_id(device_id); |
| 1635 | network->load_model(model_path); |
| 1636 | std::shared_ptr<Tensor> input_tensor = network->get_input_tensor(0); |
| 1637 | std::shared_ptr<Tensor> output_tensor = network->get_output_tensor(0); |
| 1638 | network->forward(); |
| 1639 | network->wait(); |
| 1640 | ASSERT_EQ(output_tensor->get_device_id(), device_id); |
| 1641 | } |
| 1642 | } // namespace |
| 1643 | #endif |
| 1644 |
no test coverage detected