MCPcopy Create free account
hub / github.com/apache/arrow / WaitEvent

Method WaitEvent

cpp/src/arrow/gpu/cuda_context.cc:312–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312Status CudaDevice::Stream::WaitEvent(const Device::SyncEvent& event) {
313 auto cuda_event =
314 checked_cast<const CudaDevice::SyncEvent*, const Device::SyncEvent*>(&event);
315 if (!cuda_event) {
316 return Status::Invalid("CudaDevice::Stream cannot Wait on non-cuda event");
317 }
318
319 auto cu_event = cuda_event->value();
320 if (!cu_event) {
321 return Status::Invalid("Cuda Stream cannot wait on null event");
322 }
323
324 ContextSaver set_temporary(reinterpret_cast<CUcontext>(context_.get()->handle()));
325 // we are currently building with CUDA toolkit 11.0.3 which doesn't have enum
326 // values for the flags yet. The "flags" param *must* be 0 for now.
327 CU_RETURN_NOT_OK("cuStreamWaitEvent", cuStreamWaitEvent(value(), cu_event, 0));
328 return Status::OK();
329}
330
331Status CudaDevice::Stream::Synchronize() const {
332 ContextSaver set_temporary(reinterpret_cast<CUcontext>(context_.get()->handle()));

Callers 1

TEST_FFunction · 0.80

Calls 6

valueFunction · 0.70
InvalidFunction · 0.50
OKFunction · 0.50
valueMethod · 0.45
handleMethod · 0.45
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.64