| 341 | } |
| 342 | |
| 343 | Status CudaDevice::SyncEvent::Record(const Device::Stream& st) { |
| 344 | auto cuda_stream = checked_cast<const CudaDevice::Stream*, const Device::Stream*>(&st); |
| 345 | if (!cuda_stream) { |
| 346 | return Status::Invalid("CudaDevice::Event cannot record on non-cuda stream"); |
| 347 | } |
| 348 | |
| 349 | ContextSaver set_temporary(reinterpret_cast<CUcontext>(context_.get()->handle())); |
| 350 | CU_RETURN_NOT_OK("cuEventRecord", cuEventRecord(value(), cuda_stream->value())); |
| 351 | return Status::OK(); |
| 352 | } |
| 353 | |
| 354 | // ---------------------------------------------------------------------- |
| 355 | // CudaMemoryManager implementation |