Cuda battery library
battery::atomic_memory< mem_order > Class Template Reference

#include <memory.hpp>

Public Types

template<class T >
using atomic_type = copyable_atomic< impl::atomic_t< T > >
 

Static Public Member Functions

template<class T >
CUDA static INLINEload (const atomic_type< T > &a)
 
template<class T >
CUDA static INLINE void store (atomic_type< T > &a, T v)
 
template<class T >
CUDA static INLINEexchange (atomic_type< T > &a, T v)
 

Static Public Attributes

constexpr static const bool sequential = false
 

Detailed Description

template<memory_order mem_order = memory_order_relaxed>
class battery::atomic_memory< mem_order >

Use the standard C++ atomic type, either provided by libcudacxx if we compile with a CUDA compiler, or through the STL otherwise.

Member Typedef Documentation

◆ atomic_type

template<memory_order mem_order = memory_order_relaxed>
template<class T >
using battery::atomic_memory< mem_order >::atomic_type = copyable_atomic<impl::atomic_t<T> >

Member Function Documentation

◆ load()

template<memory_order mem_order = memory_order_relaxed>
template<class T >
CUDA static INLINE T battery::atomic_memory< mem_order >::load ( const atomic_type< T > &  a)
inlinestatic

◆ store()

template<memory_order mem_order = memory_order_relaxed>
template<class T >
CUDA static INLINE void battery::atomic_memory< mem_order >::store ( atomic_type< T > &  a,
v 
)
inlinestatic

◆ exchange()

template<memory_order mem_order = memory_order_relaxed>
template<class T >
CUDA static INLINE T battery::atomic_memory< mem_order >::exchange ( atomic_type< T > &  a,
v 
)
inlinestatic

Member Data Documentation

◆ sequential

template<memory_order mem_order = memory_order_relaxed>
constexpr static const bool battery::atomic_memory< mem_order >::sequential = false
staticconstexpr

The documentation for this class was generated from the following file: