File indexing completed on 2023-03-17 11:05:46
0001 #ifndef HeterogeneousCore_CUDAUtilities_eventWorkHasCompleted_h
0002 #define HeterogeneousCore_CUDAUtilities_eventWorkHasCompleted_h
0003
0004 #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
0005
0006 #include <cuda_runtime.h>
0007
0008 namespace cms {
0009 namespace cuda {
0010
0011
0012
0013
0014
0015
0016
0017
0018 inline bool eventWorkHasCompleted(cudaEvent_t event) {
0019 const auto ret = cudaEventQuery(event);
0020 if (ret == cudaSuccess) {
0021 return true;
0022 } else if (ret == cudaErrorNotReady) {
0023 return false;
0024 }
0025
0026 cudaCheck(ret);
0027 return false;
0028 }
0029 }
0030 }
0031
0032 #endif