MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getDeviceIdFromNativeId

Function getDeviceIdFromNativeId

src/backend/opencl/platform.cpp:237–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237int getDeviceIdFromNativeId(cl_device_id id) {
238 DeviceManager& devMngr = DeviceManager::getInstance();
239
240 common::lock_guard_t lock(devMngr.deviceMutex);
241
242 int nDevices = static_cast<int>(devMngr.mDevices.size());
243 int devId = 0;
244 for (devId = 0; devId < nDevices; ++devId) {
245 if (id == devMngr.mDevices[devId]->operator()()) { break; }
246 }
247
248 return devId;
249}
250
251int getActiveDeviceType() {
252 device_id_t& devId = tlocalActiveDeviceId();

Callers 1

afcl_set_device_idFunction · 0.70

Calls 1

operator()Method · 0.45

Tested by

no test coverage detected