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

Function getDeviceCount

src/backend/oneapi/platform.cpp:215–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215int getDeviceCount() noexcept try {
216 DeviceManager& devMngr = DeviceManager::getInstance();
217
218 common::lock_guard_t lock(devMngr.deviceMutex);
219 return static_cast<int>(devMngr.mQueues.size());
220} catch (const AfError& err) {
221 UNUSED(err);
222 // If device manager threw an error then return 0 because no platforms
223 // were found
224 return 0;
225}
226
227void init() {
228 thread_local const DeviceManager& devMngr = DeviceManager::getInstance();

Callers 4

platform.cppFile · 0.70
resetMemoryManagerMethod · 0.70
~DeviceManagerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected