| 54 | } |
| 55 | |
| 56 | static CUDASharedEvent GetFromPool(CUDAEventPool &pool, int device_id = -1) { |
| 57 | if (device_id < 0) |
| 58 | CUDA_CALL(cudaGetDevice(&device_id)); |
| 59 | CUDAEvent &&event = pool.Get(device_id); |
| 60 | return CUDASharedEvent( |
| 61 | std::move(event), |
| 62 | [device_id, owner = &pool](void *e) { |
| 63 | owner->Put(CUDAEvent(static_cast<cudaEvent_t>(e)), device_id); |
| 64 | }); |
| 65 | } |
| 66 | |
| 67 | static CUDASharedEvent GetFromPool(int device_id = -1) { |
| 68 | return GetFromPool(CUDAEventPool::instance(), device_id); |
nothing calls this directly
no test coverage detected