DPC++ Runtime
Runtime libraries for oneAPI DPC++
atomic.hpp File Reference
#include <cassert>
#include <sycl/access/access.hpp>
#include <sycl/atomic_ref.hpp>
#include <sycl/memory_enums.hpp>
#include <sycl/multi_ptr.hpp>
#include <syclcompat/traits.hpp>
Include dependency graph for atomic.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  syclcompat::detail::IsValidAtomicType< T >
 
class  syclcompat::atomic< T, DefaultScope, DefaultOrder, Space >
 

Namespaces

 syclcompat
 
 syclcompat::detail
 Atomic extension to implement standard APIs in std::atomic.
 

Functions

template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_add (T *addr, arith_t< T > operand)
 Atomically add the value operand to the value at the addr and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_sub (T *addr, arith_t< T > operand)
 Atomically subtract the value operand from the value at the addr and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_and (T *addr, type_identity_t< T > operand)
 Atomically perform a bitwise AND between the value operand and the value at the addr and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_or (T *addr, type_identity_t< T > operand)
 Atomically or the value at the addr with the value operand, and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_xor (T *addr, type_identity_t< T > operand)
 Atomically xor the value at the addr with the value operand, and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_min (T *addr, type_identity_t< T > operand)
 Atomically calculate the minimum of the value at addr and the value operand and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_fetch_max (T *addr, type_identity_t< T > operand)
 Atomically calculate the maximum of the value at addr and the value operand and assign the result to the value at addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device>
unsigned int syclcompat::atomic_fetch_compare_dec (unsigned int *addr, unsigned int operand)
 Atomically set operand to the value stored in addr, if old value stored in addr is equal to zero or greater than operand, else decrease the value stored in addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device>
unsigned int syclcompat::atomic_fetch_compare_inc (unsigned int *addr, unsigned int operand)
 Atomically increment the value stored in addr if old value stored in addr is less than operand, else set 0 to the value stored in addr. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_exchange (T *addr, type_identity_t< T > operand)
 Atomically exchange the value at the address addr with the value operand. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_compare_exchange_strong (sycl::multi_ptr< T, sycl::access::address_space::generic_space > addr, type_identity_t< T > expected, type_identity_t< T > desired, sycl::memory_order success=sycl::memory_order::relaxed, sycl::memory_order fail=sycl::memory_order::relaxed)
 Atomically compare the value at addr to the value expected and exchange with the value desired if the value at addr is equal to the value expected. More...
 
template<sycl::access::address_space addressSpace = sycl::access::address_space::generic_space, sycl::memory_order memoryOrder = sycl::memory_order::relaxed, sycl::memory_scope memoryScope = sycl::memory_scope::device, typename T >
syclcompat::atomic_compare_exchange_strong (T *addr, type_identity_t< T > expected, type_identity_t< T > desired, sycl::memory_order success=sycl::memory_order::relaxed, sycl::memory_order fail=sycl::memory_order::relaxed)
 Atomically compare the value at addr to the value expected and exchange with the value desired if the value at addr is equal to the value expected. More...