Loading src/TNL/Algorithms/AtomicOperations.h +15 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,21 @@ struct AtomicOperations< Devices::Host > } }; template<> struct AtomicOperations< Devices::Sequential > { // this is __cuda_callable__ only to silence nvcc warnings (all methods inside class // template specializations must have the same execution space specifier, otherwise // nvcc complains) TNL_NVCC_HD_WARNING_DISABLE template< typename Value > __cuda_callable__ static void add( Value& v, const Value& a ) { v += a; } }; template<> struct AtomicOperations< Devices::Cuda > { Loading src/TNL/Atomic.h +12 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include <atomic> // std::atomic #include <TNL/Devices/Host.h> #include <TNL/Devices/Sequential.h> #include <TNL/Devices/Cuda.h> // double-precision atomicAdd function for Maxwell and older GPUs Loading Loading @@ -96,6 +97,17 @@ public: } }; template< typename T > class Atomic< T, Devices::Sequential > : public Atomic< T, Devices::Host > { public: using Atomic; using operator=; using fetch_max; using fetch_min; }; template< typename T > class Atomic< T, Devices::Cuda > { Loading Loading
src/TNL/Algorithms/AtomicOperations.h +15 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,21 @@ struct AtomicOperations< Devices::Host > } }; template<> struct AtomicOperations< Devices::Sequential > { // this is __cuda_callable__ only to silence nvcc warnings (all methods inside class // template specializations must have the same execution space specifier, otherwise // nvcc complains) TNL_NVCC_HD_WARNING_DISABLE template< typename Value > __cuda_callable__ static void add( Value& v, const Value& a ) { v += a; } }; template<> struct AtomicOperations< Devices::Cuda > { Loading
src/TNL/Atomic.h +12 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include <atomic> // std::atomic #include <TNL/Devices/Host.h> #include <TNL/Devices/Sequential.h> #include <TNL/Devices/Cuda.h> // double-precision atomicAdd function for Maxwell and older GPUs Loading Loading @@ -96,6 +97,17 @@ public: } }; template< typename T > class Atomic< T, Devices::Sequential > : public Atomic< T, Devices::Host > { public: using Atomic; using operator=; using fetch_max; using fetch_min; }; template< typename T > class Atomic< T, Devices::Cuda > { Loading