aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/KernelTimer.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Utils/KernelTimer.H')
-rw-r--r--Source/Utils/KernelTimer.H12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/Utils/KernelTimer.H b/Source/Utils/KernelTimer.H
index 8c13e1add..b52f0d33b 100644
--- a/Source/Utils/KernelTimer.H
+++ b/Source/Utils/KernelTimer.H
@@ -21,8 +21,14 @@ public:
* (for performance, it is recommended to allocate pinned host memory).
*/
AMREX_GPU_DEVICE
- KernelTimer (const bool do_timing, amrex::Real* cost)
- : m_do_timing(do_timing), m_cost(cost) {
+ KernelTimer
+#if (defined AMREX_USE_GPU)
+ (const bool do_timing, amrex::Real* cost)
+ : m_do_timing(do_timing), m_cost(cost)
+#else
+ (const bool, amrex::Real*)
+#endif
+ {
#if (defined AMREX_USE_GPU)
if (do_timing && cost) {
#if defined(AMREX_USE_CUDA) || defined(AMREX_USE_HIP)
@@ -53,6 +59,7 @@ public:
#endif
}
+#if (defined AMREX_USE_GPU)
private:
//! Stores whether kernel timer is active.
bool m_do_timing;
@@ -62,6 +69,7 @@ private:
//! Store the time difference (cost) from a single thread.
long long int m_wt;
+#endif
};
#endif