Skip to content

Commit

Permalink
Work around NVHPC 23.x not dealing with __isGlobal
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed May 9, 2023
1 parent 60b982a commit 417a6ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tpls/desul/include/desul/atomics/cuda/CUDA_asm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
namespace desul {
namespace Impl {
// Choose the variant of atomics we are using later
// The __isGlobal intrinsic was only introduced in CUDA 11.2
// It also stopped working in NVC++ 23.1 - it works in 22.11
// this is a bug in NVHPC, not treating CUDA intrinsics correctly
// FIXME_NVHPC
#if !defined(DESUL_IMPL_ATOMIC_CUDA_PTX_PREDICATE) && \
!defined(DESUL_IMPL_ATOMIC_CUDA_PTX_ISGLOBAL)
#if (__CUDACC_VER_MAJOR__ > 11) || \
((__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ > 1))
#if ((__CUDACC_VER_MAJOR__ > 11) || \
((__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ > 1))) && \
(!defined(__NVCOMPILER) || __NVCOMPILER_MAJOR__ < 23)
#define DESUL_IMPL_ATOMIC_CUDA_PTX_ISGLOBAL
#else
#define DESUL_IMPL_ATOMIC_CUDA_PTX_PREDICATE
Expand Down

0 comments on commit 417a6ee

Please sign in to comment.