| 449 | } |
| 450 | |
| 451 | void 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 | |
| 467 | void removeDeviceContext(sycl::device& dev, sycl::context& ctx) { |
| 468 | if (getDevice() == dev && getContext() == ctx) { |
nothing calls this directly
no test coverage detected