| 395 | } |
| 396 | |
| 397 | cudaStream_t getStream(int device) { |
| 398 | static once_flag streamInitFlags[DeviceManager::MAX_DEVICES]; |
| 399 | |
| 400 | call_once(streamInitFlags[device], [device]() { |
| 401 | DeviceManager &inst = DeviceManager::getInstance(); |
| 402 | CUDA_CHECK(cudaStreamCreate(&(inst.streams[device]))); |
| 403 | }); |
| 404 | |
| 405 | return DeviceManager::getInstance().streams[device]; |
| 406 | } |
| 407 | |
| 408 | cudaStream_t getActiveStream() { return getStream(getActiveDeviceId()); } |
| 409 |
no outgoing calls
no test coverage detected