Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
CudaTimer.ixx File Reference

GPU-accurate interval timer using a CUDA event pair. More...

#include <cuda_runtime.h>
#include <stdexcept>
#include <format>

Classes

class  Mila::Dnn::Compute::CudaTimer
 GPU-accurate interval timer using a CUDA event pair. More...

Namespaces

namespace  Mila
 Mila main API namespace.
namespace  Mila::Dnn
namespace  Mila::Dnn::Compute

Detailed Description

GPU-accurate interval timer using a CUDA event pair.

Provides CudaTimer, a lightweight RAII wrapper around two cudaEvent_t handles (start and stop). The timer records events into a CUDA stream at the desired measurement points and reads the elapsed GPU time after the stream reaches the stop event.

Intended use:

  • Beta.1 profiling pass: per-operation GPU timing in CudaProfileScope.
  • Fine-grained kernel sequence measurement without host-side synchronization at every boundary.