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

Function getDeviceCount

src/backend/opencl/platform.cpp:214–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

getOpenCLCDeviceVersionFunction · 0.70
shutdownMethod · 0.70
AllocatorPinnedMethod · 0.70
resetMemoryManagerMethod · 0.70
~DeviceManagerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected