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

Function setDevice

src/backend/opencl/platform.cpp:508–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508int setDevice(int device) {
509 DeviceManager& devMngr = DeviceManager::getInstance();
510
511 common::lock_guard_t lock(devMngr.deviceMutex);
512
513 if (device >= static_cast<int>(devMngr.mQueues.size()) ||
514 device >= static_cast<int>(DeviceManager::MAX_DEVICES)) {
515 return -1;
516 } else {
517 int old = getActiveDeviceId();
518 setActiveContext(device);
519 return old;
520 }
521}
522
523void sync(int device) {
524 int currDevice = getActiveDeviceId();

Callers 4

syncFunction · 0.70
afcl_set_device_idFunction · 0.70
shutdownMethod · 0.70
checkAndMigrateFunction · 0.70

Calls 2

getActiveDeviceIdFunction · 0.70
setActiveContextFunction · 0.70

Tested by

no test coverage detected