DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace > Class Template Reference

#include <CL/sycl/atomic_ref.hpp>

Inheritance diagram for cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >:
Collaboration diagram for cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >:

Public Types

using value_type = T
 

Public Member Functions

bool is_lock_free () const noexcept
 
 atomic_ref_base (T &ref)
 
 atomic_ref_base (const atomic_ref_base &ref) noexcept
 
atomic_ref_baseoperator= (const atomic_ref_base &)=delete
 
void store (T operand, memory_order order=default_write_order, memory_scope scope=default_scope) const noexcept
 
T operator= (T desired) const noexcept
 
T load (memory_order order=default_read_order, memory_scope scope=default_scope) const noexcept
 
 operator T () const noexcept
 
T exchange (T operand, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_strong (T &expected, T desired, memory_order success, memory_order failure, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_strong (T &expected, T desired, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_weak (T &expected, T desired, memory_order success, memory_order failure, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_weak (T &expected, T desired, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 

Static Public Attributes

static constexpr size_t required_alignment = sizeof(T)
 
static constexpr bool is_always_lock_free
 
static constexpr memory_order default_read_order
 
static constexpr memory_order default_write_order
 
static constexpr memory_order default_read_modify_write_order = DefaultOrder
 
static constexpr memory_scope default_scope = DefaultScope
 

Protected Attributes

std::atomic< T > * ptr
 

Detailed Description

template<typename T, memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
class cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >

Definition at line 116 of file atomic_ref.hpp.

Member Typedef Documentation

◆ value_type

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
using cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::value_type = T

Definition at line 132 of file atomic_ref.hpp.

Constructor & Destructor Documentation

◆ atomic_ref_base() [1/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::atomic_ref_base ( T ref)
inlineexplicit

Definition at line 151 of file atomic_ref.hpp.

◆ atomic_ref_base() [2/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::atomic_ref_base ( const atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace > &  ref)
inlinenoexcept

Definition at line 156 of file atomic_ref.hpp.

Member Function Documentation

◆ compare_exchange_strong() [1/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
bool cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::compare_exchange_strong ( T expected,
T  desired,
memory_order  order = default_read_modify_write_order,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 217 of file atomic_ref.hpp.

◆ compare_exchange_strong() [2/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
bool cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::compare_exchange_strong ( T expected,
T  desired,
memory_order  success,
memory_order  failure,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 197 of file atomic_ref.hpp.

◆ compare_exchange_weak() [1/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
bool cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::compare_exchange_weak ( T expected,
T  desired,
memory_order  order = default_read_modify_write_order,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 241 of file atomic_ref.hpp.

◆ compare_exchange_weak() [2/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
bool cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::compare_exchange_weak ( T expected,
T  desired,
memory_order  success,
memory_order  failure,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 224 of file atomic_ref.hpp.

◆ exchange()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
T cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::exchange ( T  operand,
memory_order  order = default_read_modify_write_order,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 186 of file atomic_ref.hpp.

◆ is_lock_free()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
bool cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::is_lock_free ( ) const
inlinenoexcept

Definition at line 143 of file atomic_ref.hpp.

◆ load()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
T cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::load ( memory_order  order = default_read_order,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 174 of file atomic_ref.hpp.

◆ operator T()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::operator T ( ) const
inlinenoexcept

Definition at line 184 of file atomic_ref.hpp.

◆ operator=() [1/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
atomic_ref_base& cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::operator= ( const atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace > &  )
delete

◆ operator=() [2/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
T cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::operator= ( T  desired) const
inlinenoexcept

Definition at line 169 of file atomic_ref.hpp.

◆ store()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
void cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::store ( T  operand,
memory_order  order = default_write_order,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 159 of file atomic_ref.hpp.

Member Data Documentation

◆ default_read_modify_write_order

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
constexpr memory_order cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::default_read_modify_write_order = DefaultOrder
staticconstexpr

Definition at line 140 of file atomic_ref.hpp.

◆ default_read_order

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
constexpr memory_order cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::default_read_order
staticconstexpr
Initial value:
=
detail::memory_order_traits<DefaultOrder>::read_order

Definition at line 136 of file atomic_ref.hpp.

◆ default_scope

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
constexpr memory_scope cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::default_scope = DefaultScope
staticconstexpr

Definition at line 141 of file atomic_ref.hpp.

◆ default_write_order

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
constexpr memory_order cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::default_write_order
staticconstexpr
Initial value:
=
detail::memory_order_traits<DefaultOrder>::write_order

Definition at line 138 of file atomic_ref.hpp.

◆ is_always_lock_free

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
constexpr bool cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::is_always_lock_free
staticconstexpr
Initial value:

Definition at line 134 of file atomic_ref.hpp.

◆ ptr

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
std::atomic<T>* cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::ptr
protected

Definition at line 251 of file atomic_ref.hpp.

◆ required_alignment

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
constexpr size_t cl::sycl::detail::atomic_ref_base< T, DefaultOrder, DefaultScope, AddressSpace >::required_alignment = sizeof(T)
staticconstexpr

Definition at line 133 of file atomic_ref.hpp.


The documentation for this class was generated from the following file:
cl::sycl::detail::IsValidAtomicRefType::value
static constexpr bool value
Definition: atomic_ref.hpp:33