From 82fae0bf298cba2228a55d3f9cd85362bc4ca03a Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Wed, 27 May 2026 00:26:56 +0000 Subject: [PATCH] Force-define _CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE for CUDA <13.1 --- include/cuco/detail/__config | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/cuco/detail/__config b/include/cuco/detail/__config index 673054560..2410de1e6 100644 --- a/include/cuco/detail/__config +++ b/include/cuco/detail/__config @@ -34,6 +34,15 @@ #error "CCCL version 3.0.0 or later is required" #endif +// WAR for cuCollections/804: work around the nvcc __cuda_is_local / isspacep.local +// miscompile on CUDA < 13.1. CCCL's auto-define of this macro only fires when +// NDEBUG is not set, but cuco builds Release, so define it unconditionally for +// affected toolkit versions. +#if !defined(_CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE) \ + && ((__CUDACC_VER_MAJOR__ < 13) || (__CUDACC_VER_MAJOR__ == 13 && __CUDACC_VER_MINOR__ < 1)) +#define _CCCL_ATOMIC_UNSAFE_AUTOMATIC_STORAGE +#endif + // WAR for libcudacxx/296 #define CUCO_CUDA_MINIMUM_ARCH _NV_FIRST_ARG(__CUDA_ARCH_LIST__)