alpaka
Abstraction Library for Parallel Kernel Acceleration
AtomicCpu.hpp
Go to the documentation of this file.
1 /* Copyright 2024 Andrea Bocci, Felice Pantaleo
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #pragma once
6 
8 
9 // clang 9/10/11 together with nvcc<11.6.0 as host compiler fails at compile time when using boost::atomic_ref
10 #ifdef BOOST_COMP_CLANG_AVAILABLE
11 # if(BOOST_COMP_CLANG < BOOST_VERSION_NUMBER(12, 0, 0) && BOOST_COMP_NVCC \
12  && BOOST_COMP_NVCC < BOOST_VERSION_NUMBER(11, 6, 0))
13 # if !defined(ALPAKA_DISABLE_ATOMIC_ATOMICREF)
14 # define ALPAKA_DISABLE_ATOMIC_ATOMICREF
15 # endif
16 # endif
17 #endif // BOOST_COMP_CLANG_AVAILABLE
18 
21 
22 namespace alpaka
23 {
24 #ifndef ALPAKA_DISABLE_ATOMIC_ATOMICREF
26 #else
27  using AtomicCpu = AtomicStdLibLock<16>;
28 #endif // ALPAKA_DISABLE_ATOMIC_ATOMICREF
29 
30 } // namespace alpaka
The atomic ops based on atomic_ref for CPU accelerators.
The alpaka accelerator library.