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

Function setDeviceContext

src/backend/oneapi/platform.cpp:451–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451void setDeviceContext(sycl::device& dev, sycl::context& ctx) {
452 // FIXME: add OpenGL Interop for user provided contexts later
453 DeviceManager& devMngr = DeviceManager::getInstance();
454
455 common::lock_guard_t lock(devMngr.deviceMutex);
456
457 const int dCount = static_cast<int>(devMngr.mDevices.size());
458 for (int i = 0; i < dCount; ++i) {
459 if (*devMngr.mDevices[i] == dev && *devMngr.mContexts[i] == ctx) {
460 setActiveContext(i);
461 return;
462 }
463 }
464 AF_ERROR("No matching device found", AF_ERR_ARG);
465}
466
467void removeDeviceContext(sycl::device& dev, sycl::context& ctx) {
468 if (getDevice() == dev && getContext() == ctx) {

Callers

nothing calls this directly

Calls 1

setActiveContextFunction · 0.70

Tested by

no test coverage detected