MCPcopy Create free account
hub / github.com/OAID/Tengine / RealGetDevice

Method RealGetDevice

executor/lib/device_driver.cpp:69–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69Device* DriverManager::RealGetDevice(const dev_id_t& dev_id)
70{
71 auto ir = begin();
72 auto ir_end = end();
73
74 while(ir != ir_end)
75 {
76 Driver* driver = ir->second;
77
78 int dev_num = driver->GetDeviceNum();
79
80 for(int i = 0; i < dev_num; i++)
81 {
82 Device* dev = driver->GetDevice(i);
83
84 if(dev->GetDeviceID() == dev_id)
85 return dev;
86 }
87
88 ir++;
89 }
90
91 return nullptr;
92}
93
94Device* DriverManager::GetDevice(const dev_id_t& dev_id)
95{

Callers 1

GetDeviceMethod · 0.80

Calls 2

GetDeviceNumMethod · 0.45
GetDeviceMethod · 0.45

Tested by

no test coverage detected