/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
HeterogeneousCore/CUDAUtilities/interface/eventWorkHasCompleted.h
32 строки
924 B
Andrea Bocci
Rename GPU check macros to uppercase
24 июл 2026, 18:36
Не верифицирован
24 июл 2026, 18:36
4ca8016
Код
Авторство
О чём код?
#ifndef HeterogeneousCore_CUDAUtilities_eventWorkHasCompleted_h #define HeterogeneousCore_CUDAUtilities_eventWorkHasCompleted_h #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" #include <cuda_runtime.h> namespace cms { namespace cuda { /** * Returns true if the work captured by the event (=queued to the * CUDA stream at the point of cudaEventRecord()) has completed. * * Returns false if any captured work is incomplete. * * In case of errors, throws an exception. */ inline bool eventWorkHasCompleted(cudaEvent_t event) { const auto ret = cudaEventQuery(event); if (ret == cudaSuccess) { return true; } else if (ret == cudaErrorNotReady) { return false; } // leave error case handling to cudaCheck CUDA_CHECK(ret); return false; // to keep compiler happy } } // namespace cuda } // namespace cms #endif