CMS 3D CMS Logo

eventWorkHasCompleted.h
Go to the documentation of this file.
1 #ifndef HeterogeneousCore_CUDAUtilities_eventWorkHasCompleted_h
2 #define HeterogeneousCore_CUDAUtilities_eventWorkHasCompleted_h
3 
5 
6 #include <cuda_runtime.h>
7 
8 namespace cms {
9  namespace cuda {
18  inline bool eventWorkHasCompleted(cudaEvent_t event) {
19  const auto ret = cudaEventQuery(event);
20  if (ret == cudaSuccess) {
21  return true;
22  } else if (ret == cudaErrorNotReady) {
23  return false;
24  }
25  // leave error case handling to cudaCheck
26  cudaCheck(ret);
27  return false; // to keep compiler happy
28  }
29  } // namespace cuda
30 } // namespace cms
31 
32 #endif
ret
prodAgent to be discontinued
Namespace of DDCMS conversion namespace.
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
bool eventWorkHasCompleted(cudaEvent_t event)
Definition: event.py:1