DPC++ Runtime
Runtime libraries for oneAPI DPC++
atomic.hpp File Reference
#include <CL/__spirv/spirv_ops.hpp>
#include <sycl/access/access.hpp>
#include <sycl/detail/cl.h>
#include <sycl/detail/helpers.hpp>
#include <sycl/memory_enums.hpp>
#include <atomic>
#include <type_traits>
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  sycl::_V1::detail::IsValidAtomicType< T >
 
struct  sycl::_V1::detail::IsValidAtomicAddressSpace< AS >
 
struct  sycl::_V1::detail::GetSpirvMemoryScope< AS >
 
struct  sycl::_V1::detail::GetSpirvMemoryScope< access::address_space::global_space >
 
struct  sycl::_V1::detail::GetSpirvMemoryScope< access::address_space::ext_intel_global_device_space >
 
struct  sycl::_V1::detail::GetSpirvMemoryScope< access::address_space::local_space >
 

Namespaces

 sycl
 ---— Error handling, matching OpenCL plugin semantics.
 
 sycl::_V1
 
 sycl::_V1::detail
 

Macros

#define __SYCL_STATIC_ASSERT_NOT_FLOAT(T)
 

Typedefs

using sycl::_V1::detail::memory_order = sycl::memory_order
 

Functions

static std::memory_order sycl::_V1::detail::getStdMemoryOrder (__spv::MemorySemanticsMask::Flag)
 
template<typename T >
void __spirv_AtomicStore (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicLoad (const std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS)
 
template<typename T >
__spirv_AtomicExchange (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicIAdd (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicISub (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicAnd (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicOr (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicXor (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicMin (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T >
__spirv_AtomicMax (std::atomic< T > *Ptr, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag MS, T V)
 
template<typename T , access::address_space addressSpace = access::address_space::global_space>
class sycl::_V1::__SYCL2020_DEPRECATED ("sycl::atomic is deprecated since SYCL 2020") atomic
 
template<typename T , access::address_space addressSpace>
void sycl::_V1::atomic_store (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_load (atomic< T, addressSpace > Object, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_exchange (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
bool sycl::_V1::atomic_compare_exchange_strong (atomic< T, addressSpace > Object, T &Expected, T Desired, memory_order SuccessOrder=memory_order::relaxed, memory_order FailOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_add (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_sub (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_and (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_or (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_xor (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_min (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 
template<typename T , access::address_space addressSpace>
sycl::_V1::atomic_fetch_max (atomic< T, addressSpace > Object, T Operand, memory_order MemoryOrder=memory_order::relaxed)
 

Macro Definition Documentation

◆ __SYCL_STATIC_ASSERT_NOT_FLOAT

#define __SYCL_STATIC_ASSERT_NOT_FLOAT (   T)
Value:
static_assert(!std::is_same<T, float>::value, \
"SYCL atomic function not available for float type")

Definition at line 24 of file atomic.hpp.

Function Documentation

◆ __spirv_AtomicAnd()

template<typename T >
T __spirv_AtomicAnd ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 124 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicExchange()

template<typename T >
T __spirv_AtomicExchange ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 106 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicIAdd()

template<typename T >
T __spirv_AtomicIAdd ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 112 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicISub()

template<typename T >
T __spirv_AtomicISub ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 118 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicLoad()

template<typename T >
T __spirv_AtomicLoad ( const std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS 
)

Definition at line 100 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicMax()

template<typename T >
T __spirv_AtomicMax ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 155 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicMin()

template<typename T >
T __spirv_AtomicMin ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 142 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicOr()

template<typename T >
T __spirv_AtomicOr ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 130 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicStore()

template<typename T >
void __spirv_AtomicStore ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 94 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().

◆ __spirv_AtomicXor()

template<typename T >
T __spirv_AtomicXor ( std::atomic< T > *  Ptr,
__spv::Scope::Flag  ,
__spv::MemorySemanticsMask::Flag  MS,
V 
)

Definition at line 136 of file atomic.hpp.

References sycl::_V1::detail::getStdMemoryOrder().