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

Method GetDevExecutorByName

executor/lib/dev_executor.cpp:83–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool DevExecutorManager::GetDevExecutorByName(const std::string& dev_name, DevExecutor*& dev_executor)
84{
85 auto manager = GetInstance();
86 bool found = false;
87
88 manager->Lock();
89 auto ir = (*manager).begin();
90 auto end = (*manager).end();
91
92 while(ir != end)
93 {
94 auto dev = ir->second;
95
96 if(dev->GetName() == dev_name)
97 {
98 found = true;
99 dev_executor = dev;
100 break;
101 }
102
103 ir++;
104 }
105
106 manager->Unlock();
107
108 return found;
109}
110
111int DevExecutorManager::GetDevExecutorNum(void)
112{

Callers

nothing calls this directly

Calls 5

beginMethod · 0.80
endMethod · 0.80
GetNameMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected