From 1f68ab49e9631dbeb707415566b0efba1163882c Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Thu, 12 Jan 2023 13:14:03 -0500 Subject: [PATCH] Desul atomics cleanup enable GCC or MSVC atomics --- tpls/desul/include/desul/atomics/Macros.hpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tpls/desul/include/desul/atomics/Macros.hpp b/tpls/desul/include/desul/atomics/Macros.hpp index 61e14783d5..8b57e50042 100644 --- a/tpls/desul/include/desul/atomics/Macros.hpp +++ b/tpls/desul/include/desul/atomics/Macros.hpp @@ -11,26 +11,16 @@ SPDX-License-Identifier: (BSD-3-Clause) // Macros -#if (!defined(__CUDA_ARCH__) || !defined(__NVCC__)) && \ - (!defined(__HIP_DEVICE_COMPILE) || !defined(__HIP_PLATFORM_HCC__)) && \ - !defined(__SYCL_DEVICE_ONLY__) && !defined(DESUL_HAVE_OPENMP_ATOMICS) -#define DESUL_IMPL_HAVE_GCC_OR_MSVC_ATOMICS -#endif - -// ONLY use GNUC atomics if not compiling for the device -// and we didn't explicitly say to use OpenMP atomics -#if defined(__GNUC__) && defined(DESUL_IMPL_HAVE_GCC_OR_MSVC_ATOMICS) +// ONLY use GNUC atomics if not explicitly say to use OpenMP atomics +#if !defined(DESUL_HAVE_OPENMP_ATOMICS) && defined(__GNUC__) #define DESUL_HAVE_GCC_ATOMICS #endif -// Equivalent to above: if we are compiling for the device we -// need to use CUDA/HIP/SYCL atomics instead of MSVC atomics -#if defined(_MSC_VER) && defined(DESUL_IMPL_HAVE_GCC_OR_MSVC_ATOMICS) +// Equivalent to above for MSVC atomics +#if !defined(DESUL_HAVE_OPENMP_ATOMICS) && defined(_MSC_VER) #define DESUL_HAVE_MSVC_ATOMICS #endif -#undef DESUL_IMPL_HAVE_GCC_OR_MSVC_ATOMICS - #ifdef __CUDACC__ #define DESUL_HAVE_CUDA_ATOMICS #endif