29 #if (defined AMREX_USE_GPU) 30 (
const bool do_timing, amrex::Real* cost)
31 : m_do_timing(do_timing)
33 (
const bool, amrex::Real*)
36 #if (defined AMREX_USE_GPU) 37 # if (defined WARPX_USE_GPUCLOCK) 38 if (m_do_timing && cost) {
40 # if defined(AMREX_USE_CUDA) || defined(AMREX_USE_HIP) 44 # elif defined(AMREX_USE_DPCPP) 46 AMREX_ALWAYS_ASSERT_WITH_MESSAGE( m_do_timing ==
false,
47 "KernelTimer not yet supported for this hardware." );
50 # else // WARPX_USE_GPUCLOCK 51 AMREX_ALWAYS_ASSERT_WITH_MESSAGE( m_do_timing ==
false,
52 "`algo.load_balance_costs_update = gpuclock` requires to compile with `-DWarpX_GPUCLOCK=ON`.");
53 # endif // WARPX_USE_GPUCLOCK 54 #endif // AMREX_USE_GPU 60 #if (defined AMREX_USE_GPU) 61 if (m_do_timing && m_cost) {
62 # if defined(AMREX_USE_CUDA) || defined(AMREX_USE_HIP) 63 m_wt = clock64() - m_wt;
64 amrex::Gpu::Atomic::Add( m_cost, amrex::Real(m_wt));
65 # elif defined(AMREX_USE_DPCPP) 72 #if (defined AMREX_USE_GPU) 78 amrex::Real* m_cost =
nullptr;
AMREX_GPU_DEVICE ~KernelTimer()
Destructor.
Definition: KernelTimer.H:59
Defines a timer object to be used on GPU; measures summed thread cycles.
Definition: KernelTimer.H:19