From 31ed5bfd34e2e8d36fbe1cef8b34b5789d7f64a2 Mon Sep 17 00:00:00 2001 From: Felix Thaler Date: Tue, 29 Oct 2024 15:35:31 +0100 Subject: [PATCH] Revert "Minor cleanup" This reverts commit c33ddd25fbb9d92358716e1f4f715fb074188e84. --- include/gridtools/common/const_ptr_deref.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/gridtools/common/const_ptr_deref.hpp b/include/gridtools/common/const_ptr_deref.hpp index f156059c6..fd9fc2ac2 100644 --- a/include/gridtools/common/const_ptr_deref.hpp +++ b/include/gridtools/common/const_ptr_deref.hpp @@ -17,11 +17,15 @@ namespace gridtools { -#if defined(GT_CUDACC) && defined(GT_CUDA_ARCH) +#ifdef GT_CUDACC template GT_FUNCTION constexpr std::enable_if_t::value, T> const_ptr_deref(T const *ptr) { +#ifdef GT_CUDA_ARCH return __ldg(ptr); +#else + return *ptr; +#endif } #endif