16 Event() { KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventCreate(&
event)); }
18 ~Event() { KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventDestroy(
event)); }
20 void record(
const Kokkos::Cuda& space) { KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventRecord(
event, space.cuda_stream())); }
22 template <
typename Duration = milliseconds>
24 return std::chrono::duration_cast<Duration>(std::chrono::duration<float, std::milli>(elapsed(other)));
33 float elapsed(
Event& other)
35 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventSynchronize(other.
event));
36 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventSynchronize(
event));
39 KOKKOS_IMPL_CUDA_SAFE_CALL(cudaEventElapsedTime(&elapsed_time,
event, other.
event));