DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
cl::sycl::multi_ptr< ElementType, Space > Class Template Reference

Provides constructors for address space qualified and non address space qualified pointers to allow interoperability between plain C++ and OpenCL C. More...

#include <CL/sycl/atomic.hpp>

Collaboration diagram for cl::sycl::multi_ptr< ElementType, Space >:

Public Types

using element_type = detail::conditional_t< std::is_same< ElementType, half >::value, cl::sycl::detail::half_impl::BIsRepresentationT, ElementType >
 
using difference_type = std::ptrdiff_t
 
using pointer_t = typename detail::DecoratedType< ElementType, Space >::type *
 
using const_pointer_t = typename detail::DecoratedType< ElementType, Space >::type const *
 
using reference_t = typename detail::DecoratedType< ElementType, Space >::type &
 
using const_reference_t = typename detail::DecoratedType< ElementType, Space >::type &
 
using ReturnPtr = detail::const_if_const_AS< Space, ElementType > *
 
using ReturnRef = detail::const_if_const_AS< Space, ElementType > &
 
using ReturnConstRef = const ElementType &
 

Public Member Functions

 multi_ptr ()
 
 multi_ptr (const multi_ptr &rhs)=default
 
 multi_ptr (multi_ptr &&)=default
 
 multi_ptr (ElementType *pointer)
 
 multi_ptr (std::nullptr_t)
 
 ~multi_ptr ()=default
 
multi_ptroperator= (const multi_ptr &)=default
 
multi_ptroperator= (multi_ptr &&)=default
 
multi_ptroperator= (ElementType *pointer)
 
multi_ptroperator= (std::nullptr_t)
 
ReturnRef operator* () const
 
ReturnPtr operator-> () const
 
ReturnRef operator[] (difference_type index)
 
ReturnConstRef operator[] (difference_type index) const
 
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && (Space == access::address_space::global_space || Space == access::address_space::global_device_space)>>
 multi_ptr (accessor< ElementType, dimensions, Mode, access::target::global_buffer, isPlaceholder, PropertyListT > Accessor)
 
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::local_space>>
 multi_ptr (accessor< ElementType, dimensions, Mode, access::target::local, isPlaceholder, PropertyListT > Accessor)
 
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::constant_space>>
 multi_ptr (accessor< ElementType, dimensions, Mode, access::target::constant_buffer, isPlaceholder, PropertyListT > Accessor)
 
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && (Space == access::address_space::global_space || Space == access::address_space::global_device_space) && std::is_const<ET>::value && std::is_same<ET, ElementType>::value>>
 multi_ptr (accessor< typename detail::remove_const_t< ET >, dimensions, Mode, access::target::global_buffer, isPlaceholder, PropertyListT > Accessor)
 
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::local_space && std::is_const<ET>::value && std::is_same<ET, ElementType>::value>>
 multi_ptr (accessor< typename detail::remove_const_t< ET >, dimensions, Mode, access::target::local, isPlaceholder, PropertyListT > Accessor)
 
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::constant_space && std::is_const<ET>::value && std::is_same<ET, ElementType>::value>>
 multi_ptr (accessor< typename detail::remove_const_t< ET >, dimensions, Mode, access::target::constant_buffer, isPlaceholder, PropertyListT > Accessor)
 
template<typename ET = ElementType>
 multi_ptr (typename detail::enable_if_t< std::is_const< ET >::value &&std::is_same< ET, ElementType >::value, const multi_ptr< typename detail::remove_const_t< ET >, Space >> &ETP)
 
pointer_t get () const
 
 operator ReturnPtr () const
 
template<typename ET = ElementType>
 operator multi_ptr< typename detail::enable_if_t< std::is_same< ET, ElementType >::value &&!std::is_const< ET >::value, void >::type, Space > () const
 
template<typename ET = ElementType>
 operator multi_ptr< typename detail::enable_if_t< std::is_same< ET, ElementType >::value &&std::is_const< ET >::value, const void >::type, Space > () const
 
 operator multi_ptr< const ElementType, Space > () const
 
multi_ptroperator++ ()
 
multi_ptr operator++ (int)
 
multi_ptroperator-- ()
 
multi_ptr operator-- (int)
 
multi_ptroperator+= (difference_type r)
 
multi_ptroperator-= (difference_type r)
 
multi_ptr operator+ (difference_type r) const
 
multi_ptr operator- (difference_type r) const
 
template<access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::global_space>>
void prefetch (size_t NumElements) const
 

Static Public Attributes

static constexpr access::address_space address_space = Space
 

Detailed Description

template<typename ElementType, access::address_space Space>
class cl::sycl::multi_ptr< ElementType, Space >

Provides constructors for address space qualified and non address space qualified pointers to allow interoperability between plain C++ and OpenCL C.

Definition at line 32 of file atomic.hpp.

Member Typedef Documentation

◆ const_pointer_t

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::const_pointer_t = typename detail::DecoratedType<ElementType, Space>::type const *

Definition at line 41 of file multi_ptr.hpp.

◆ const_reference_t

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::const_reference_t = typename detail::DecoratedType<ElementType, Space>::type &

Definition at line 45 of file multi_ptr.hpp.

◆ difference_type

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::difference_type = std::ptrdiff_t

Definition at line 35 of file multi_ptr.hpp.

◆ element_type

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::element_type = detail::conditional_t<std::is_same<ElementType, half>::value, cl::sycl::detail::half_impl::BIsRepresentationT, ElementType>

Definition at line 34 of file multi_ptr.hpp.

◆ pointer_t

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::pointer_t = typename detail::DecoratedType<ElementType, Space>::type *

Definition at line 39 of file multi_ptr.hpp.

◆ reference_t

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::reference_t = typename detail::DecoratedType<ElementType, Space>::type &

Definition at line 43 of file multi_ptr.hpp.

◆ ReturnConstRef

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::ReturnConstRef = const ElementType &

Definition at line 94 of file multi_ptr.hpp.

◆ ReturnPtr

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::ReturnPtr = detail::const_if_const_AS<Space, ElementType> *

Definition at line 92 of file multi_ptr.hpp.

◆ ReturnRef

template<typename ElementType , access::address_space Space>
using cl::sycl::multi_ptr< ElementType, Space >::ReturnRef = detail::const_if_const_AS<Space, ElementType> &

Definition at line 93 of file multi_ptr.hpp.

Constructor & Destructor Documentation

◆ multi_ptr() [1/12]

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( )
inline

Definition at line 50 of file multi_ptr.hpp.

◆ multi_ptr() [2/12]

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( const multi_ptr< ElementType, Space > &  rhs)
default

◆ multi_ptr() [3/12]

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( multi_ptr< ElementType, Space > &&  )
default

◆ multi_ptr() [4/12]

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( ElementType *  pointer)
inline

Definition at line 57 of file multi_ptr.hpp.

◆ multi_ptr() [5/12]

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( std::nullptr_t  )
inline

Definition at line 66 of file multi_ptr.hpp.

◆ ~multi_ptr()

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::~multi_ptr ( )
default

◆ multi_ptr() [6/12]

template<typename ElementType , access::address_space Space>
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && (Space == access::address_space::global_space || Space == access::address_space::global_device_space)>>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( accessor< ElementType, dimensions, Mode, access::target::global_buffer, isPlaceholder, PropertyListT >  Accessor)
inline

Definition at line 120 of file multi_ptr.hpp.

◆ multi_ptr() [7/12]

template<typename ElementType , access::address_space Space>
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::local_space>>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( accessor< ElementType, dimensions, Mode, access::target::local, isPlaceholder, PropertyListT >  Accessor)
inline

Definition at line 133 of file multi_ptr.hpp.

◆ multi_ptr() [8/12]

template<typename ElementType , access::address_space Space>
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::constant_space>>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( accessor< ElementType, dimensions, Mode, access::target::constant_buffer, isPlaceholder, PropertyListT >  Accessor)
inline

Definition at line 144 of file multi_ptr.hpp.

◆ multi_ptr() [9/12]

template<typename ElementType , access::address_space Space>
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && (Space == access::address_space::global_space || Space == access::address_space::global_device_space) && std::is_const<ET>::value && std::is_same<ET, ElementType>::value>>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( accessor< typename detail::remove_const_t< ET >, dimensions, Mode, access::target::global_buffer, isPlaceholder, PropertyListT >  Accessor)
inline

Definition at line 169 of file multi_ptr.hpp.

◆ multi_ptr() [10/12]

template<typename ElementType , access::address_space Space>
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::local_space && std::is_const<ET>::value && std::is_same<ET, ElementType>::value>>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( accessor< typename detail::remove_const_t< ET >, dimensions, Mode, access::target::local, isPlaceholder, PropertyListT >  Accessor)
inline

Definition at line 183 of file multi_ptr.hpp.

◆ multi_ptr() [11/12]

template<typename ElementType , access::address_space Space>
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder, typename PropertyListT , access::address_space _Space = Space, typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::constant_space && std::is_const<ET>::value && std::is_same<ET, ElementType>::value>>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( accessor< typename detail::remove_const_t< ET >, dimensions, Mode, access::target::constant_buffer, isPlaceholder, PropertyListT >  Accessor)
inline

Definition at line 196 of file multi_ptr.hpp.

◆ multi_ptr() [12/12]

template<typename ElementType , access::address_space Space>
template<typename ET = ElementType>
cl::sycl::multi_ptr< ElementType, Space >::multi_ptr ( typename detail::enable_if_t< std::is_const< ET >::value &&std::is_same< ET, ElementType >::value, const multi_ptr< typename detail::remove_const_t< ET >, Space >> &  ETP)
inline

Definition at line 209 of file multi_ptr.hpp.

Member Function Documentation

◆ get()

◆ operator multi_ptr< const ElementType, Space >()

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::operator multi_ptr< const ElementType, Space > ( ) const
inline

Definition at line 245 of file multi_ptr.hpp.

◆ operator multi_ptr< typename detail::enable_if_t< std::is_same< ET, ElementType >::value &&!std::is_const< ET >::value, void >::type, Space >()

template<typename ElementType , access::address_space Space>
template<typename ET = ElementType>
cl::sycl::multi_ptr< ElementType, Space >::operator multi_ptr< typename detail::enable_if_t< std::is_same< ET, ElementType >::value &&!std::is_const< ET >::value, void >::type, Space > ( ) const
inline

Definition at line 227 of file multi_ptr.hpp.

◆ operator multi_ptr< typename detail::enable_if_t< std::is_same< ET, ElementType >::value &&std::is_const< ET >::value, const void >::type, Space >()

template<typename ElementType , access::address_space Space>
template<typename ET = ElementType>
cl::sycl::multi_ptr< ElementType, Space >::operator multi_ptr< typename detail::enable_if_t< std::is_same< ET, ElementType >::value &&std::is_const< ET >::value, const void >::type, Space > ( ) const
inline

Definition at line 239 of file multi_ptr.hpp.

◆ operator ReturnPtr()

template<typename ElementType , access::address_space Space>
cl::sycl::multi_ptr< ElementType, Space >::operator ReturnPtr ( ) const
inline

Definition at line 218 of file multi_ptr.hpp.

◆ operator*()

template<typename ElementType , access::address_space Space>
ReturnRef cl::sycl::multi_ptr< ElementType, Space >::operator* ( ) const
inline

Definition at line 96 of file multi_ptr.hpp.

◆ operator+()

template<typename ElementType , access::address_space Space>
multi_ptr cl::sycl::multi_ptr< ElementType, Space >::operator+ ( difference_type  r) const
inline

Definition at line 279 of file multi_ptr.hpp.

References cl::sycl::r.

◆ operator++() [1/2]

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator++ ( )
inline

Definition at line 253 of file multi_ptr.hpp.

◆ operator++() [2/2]

template<typename ElementType , access::address_space Space>
multi_ptr cl::sycl::multi_ptr< ElementType, Space >::operator++ ( int  )
inline

Definition at line 257 of file multi_ptr.hpp.

◆ operator+=()

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator+= ( difference_type  r)
inline

Definition at line 271 of file multi_ptr.hpp.

References cl::sycl::r.

◆ operator-()

template<typename ElementType , access::address_space Space>
multi_ptr cl::sycl::multi_ptr< ElementType, Space >::operator- ( difference_type  r) const
inline

Definition at line 282 of file multi_ptr.hpp.

References cl::sycl::r.

◆ operator--() [1/2]

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator-- ( )
inline

Definition at line 262 of file multi_ptr.hpp.

◆ operator--() [2/2]

template<typename ElementType , access::address_space Space>
multi_ptr cl::sycl::multi_ptr< ElementType, Space >::operator-- ( int  )
inline

Definition at line 266 of file multi_ptr.hpp.

◆ operator-=()

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator-= ( difference_type  r)
inline

Definition at line 275 of file multi_ptr.hpp.

References cl::sycl::r.

◆ operator->()

template<typename ElementType , access::address_space Space>
ReturnPtr cl::sycl::multi_ptr< ElementType, Space >::operator-> ( ) const
inline

Definition at line 100 of file multi_ptr.hpp.

◆ operator=() [1/4]

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator= ( const multi_ptr< ElementType, Space > &  )
default

◆ operator=() [2/4]

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator= ( ElementType *  pointer)
inline

Definition at line 80 of file multi_ptr.hpp.

◆ operator=() [3/4]

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator= ( multi_ptr< ElementType, Space > &&  )
default

◆ operator=() [4/4]

template<typename ElementType , access::address_space Space>
multi_ptr& cl::sycl::multi_ptr< ElementType, Space >::operator= ( std::nullptr_t  )
inline

Definition at line 87 of file multi_ptr.hpp.

◆ operator[]() [1/2]

template<typename ElementType , access::address_space Space>
ReturnRef cl::sycl::multi_ptr< ElementType, Space >::operator[] ( difference_type  index)
inline

Definition at line 104 of file multi_ptr.hpp.

◆ operator[]() [2/2]

template<typename ElementType , access::address_space Space>
ReturnConstRef cl::sycl::multi_ptr< ElementType, Space >::operator[] ( difference_type  index) const
inline

Definition at line 108 of file multi_ptr.hpp.

◆ prefetch()

template<typename ElementType , access::address_space Space>
template<access::address_space _Space = Space, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::global_space>>
void cl::sycl::multi_ptr< ElementType, Space >::prefetch ( size_t  NumElements) const
inline

Definition at line 309 of file multi_ptr.hpp.

References __spirv_ocl_prefetch().

Member Data Documentation

◆ address_space

template<typename ElementType , access::address_space Space>
constexpr access::address_space cl::sycl::multi_ptr< ElementType, Space >::address_space = Space
staticconstexpr

Definition at line 47 of file multi_ptr.hpp.


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