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

#include <CL/sycl/atomic_ref.hpp>

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

Public Types

using value_type = T *
 
using difference_type = ptrdiff_t
 
- Public Types inherited from cl::sycl::detail::atomic_ref_base< uintptr_t, DefaultOrder, DefaultScope, AddressSpace >
using value_type = uintptr_t
 

Public Member Functions

 atomic_ref_impl (T *&ref)
 
void store (T *operand, memory_order order=default_write_order, memory_scope scope=default_scope) const noexcept
 
Toperator= (T *desired) const noexcept
 
Tload (memory_order order=default_read_order, memory_scope scope=default_scope) const noexcept
 
 operator T* () const noexcept
 
Texchange (T *operand, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
Tfetch_add (difference_type operand, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
Toperator+= (difference_type operand) const noexcept
 
Toperator++ (int) const noexcept
 
Toperator++ () const noexcept
 
Tfetch_sub (difference_type operand, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
Toperator-= (difference_type operand) const noexcept
 
Toperator-- (int) const noexcept
 
Toperator-- () 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
 
- Public Member Functions inherited from cl::sycl::detail::atomic_ref_base< uintptr_t, DefaultOrder, DefaultScope, AddressSpace >
bool is_lock_free () const noexcept
 
 atomic_ref_base (uintptr_t &ref)
 
 atomic_ref_base (const atomic_ref_base &ref) noexcept
 
atomic_ref_baseoperator= (const atomic_ref_base &)=delete
 
uintptr_t operator= (uintptr_t desired) const noexcept
 
void store (uintptr_t operand, memory_order order=default_write_order, memory_scope scope=default_scope) const noexcept
 
uintptr_t load (memory_order order=default_read_order, memory_scope scope=default_scope) const noexcept
 
 operator uintptr_t () const noexcept
 
uintptr_t exchange (uintptr_t operand, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_strong (uintptr_t &expected, uintptr_t desired, memory_order success, memory_order failure, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_strong (uintptr_t &expected, uintptr_t desired, memory_order order=default_read_modify_write_order, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_weak (uintptr_t &expected, uintptr_t desired, memory_order success, memory_order failure, memory_scope scope=default_scope) const noexcept
 
bool compare_exchange_weak (uintptr_t &expected, uintptr_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
 
- Static Public Attributes inherited from cl::sycl::detail::atomic_ref_base< uintptr_t, DefaultOrder, DefaultScope, AddressSpace >
static constexpr size_t required_alignment
 
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
 
static constexpr memory_scope default_scope
 

Additional Inherited Members

- Protected Attributes inherited from cl::sycl::detail::atomic_ref_base< uintptr_t, DefaultOrder, DefaultScope, AddressSpace >
std::atomic< uintptr_t > * ptr
 

Detailed Description

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

Definition at line 525 of file atomic_ref.hpp.

Member Typedef Documentation

◆ difference_type

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
using cl::sycl::detail::atomic_ref_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::difference_type = ptrdiff_t

Definition at line 535 of file atomic_ref.hpp.

◆ value_type

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

Definition at line 534 of file atomic_ref.hpp.

Constructor & Destructor Documentation

◆ atomic_ref_impl()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
cl::sycl::detail::atomic_ref_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::atomic_ref_impl ( T *&  ref)
inline

Definition at line 548 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_impl< 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 630 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_impl< 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 621 of file atomic_ref.hpp.

References cl::sycl::success.

◆ compare_exchange_weak() [1/2]

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
bool cl::sycl::detail::atomic_ref_impl< 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 646 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_impl< 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 637 of file atomic_ref.hpp.

References cl::sycl::success.

◆ exchange()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
T* cl::sycl::detail::atomic_ref_impl< 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 567 of file atomic_ref.hpp.

◆ fetch_add()

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

Definition at line 573 of file atomic_ref.hpp.

References cl::sycl::ext::oneapi::detail::getLoadOrder().

◆ fetch_sub()

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

Definition at line 597 of file atomic_ref.hpp.

References cl::sycl::ext::oneapi::detail::getLoadOrder().

◆ load()

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

Definition at line 560 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::operator T* ( ) const
inlinenoexcept

Definition at line 565 of file atomic_ref.hpp.

◆ operator++() [1/2]

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

Definition at line 593 of file atomic_ref.hpp.

◆ operator++() [2/2]

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

Definition at line 591 of file atomic_ref.hpp.

◆ operator+=()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
T* cl::sycl::detail::atomic_ref_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::operator+= ( difference_type  operand) const
inlinenoexcept

Definition at line 587 of file atomic_ref.hpp.

◆ operator--() [1/2]

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

Definition at line 616 of file atomic_ref.hpp.

◆ operator--() [2/2]

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

Definition at line 614 of file atomic_ref.hpp.

◆ operator-=()

template<typename T , memory_order DefaultOrder, memory_scope DefaultScope, access::address_space AddressSpace>
T* cl::sycl::detail::atomic_ref_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::operator-= ( difference_type  operand) const
inlinenoexcept

Definition at line 610 of file atomic_ref.hpp.

◆ operator=()

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

Definition at line 555 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::store ( T operand,
memory_order  order = default_write_order,
memory_scope  scope = default_scope 
) const
inlinenoexcept

Definition at line 550 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::default_read_modify_write_order = DefaultOrder
staticconstexpr

Definition at line 543 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::default_read_order
staticconstexpr
Initial value:
=
detail::memory_order_traits<DefaultOrder>::read_order

Definition at line 539 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::default_scope = DefaultScope
staticconstexpr

Definition at line 544 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::default_write_order
staticconstexpr
Initial value:
=
detail::memory_order_traits<DefaultOrder>::write_order

Definition at line 541 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::is_always_lock_free
staticconstexpr
Initial value:

Definition at line 537 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_impl< T *, DefaultOrder, DefaultScope, AddressSpace >::required_alignment = sizeof(T *)
staticconstexpr

Definition at line 536 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