cl::sycl::multi_ptr< dataType, asp > Class Template Reference
multi_ptr, generic pointer class. More...
#include <multi_pointer.h>
Public Types | |
using | reference = typename multi_ptr_base::asp_type & |
using | reference = const typename multi_ptr_base::asp_type & |
using | value_type = typename multi_ptr_base::element_type |
using | difference_type = typename multi_ptr_base::difference_type |
using | pointer = ptr_t |
using | pointer = typename multi_ptr_base::const_pointer_t |
Public Member Functions | |
multi_ptr ()=default | |
Default constructor. More... | |
multi_ptr (ptr_t ptr) | |
Initialize the object using the given pointer. More... | |
template<COMPUTECPP_ENABLE_IF(dataType,(std::is_const< dataType >::value)) > | |
multi_ptr (const multi_ptr< non_const_data_t, asp > &rhs) | |
Copy constructor from a non-const multi_ptr. More... | |
multi_ptr (const multi_ptr< void, asp > &rhs) | |
Copy constructor from a void multi_ptr. More... | |
template<COMPUTECPP_ENABLE_IF(dataType,(std::is_const< dataType >::value)) > | |
multi_ptr (const multi_ptr< const void, asp > &rhs) | |
Copy constructor from a const void multi_ptr. More... | |
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder = access::placeholder::false_t, COMPUTECPP_ENABLE_IF(dataType,(detail::address_space_trait< dataType, asp >::hasTarget)) > | |
multi_ptr (cl::sycl::accessor< non_const_data_t, dimensions, Mode, detail::address_space_trait< non_const_data_t, asp >::targetValue, isPlaceholder > acc) | |
Initialize the object using an accessor to non-const data. More... | |
template<int dimensions, access::mode Mode, access::placeholder isPlaceholder = access::placeholder::false_t, COMPUTECPP_ENABLE_IF(dataType,(detail::address_space_trait< dataType, asp >::hasTarget && std::is_const< dataType >::value)) > | |
multi_ptr (cl::sycl::accessor< const non_const_data_t, dimensions, Mode, detail::address_space_trait< const non_const_data_t, asp >::targetValue, isPlaceholder > acc) | |
Initialize the object using an accessor to const data. More... | |
template<COMPUTECPP_ENABLE_IF(dataType,(!std::is_same< ptr_t, ptr_unqual_t >::value)) > | |
multi_ptr (ptr_unqual_t ptr) | |
Initialize the object using the given non address space qualified pointer. More... | |
operator multi_ptr< void_conversion_t, asp > () const | |
Implicit conversion to multi_ptr<(const) void>. More... | |
original_type_ref | operator* () |
original_type_cref | operator* () const |
COMPUTECPP_DEPRECATED_BY_SYCL_VER (201703, "multi_ptr::operator[] is no longer available.") original_type_ref operator[](size_t i) | |
COMPUTECPP_DEPRECATED_BY_SYCL_VER (201703, "multi_ptr::operator[] is no longer available.") original_type_cref operator[](size_t i) const | |
multi_ptr & | operator++ () |
Increments the underlying pointer by 1. More... | |
multi_ptr | operator++ (int) |
Increments the underlying pointer by 1 and returns a new multi_ptr with the value of the previous pointer. More... | |
multi_ptr & | operator-- () |
Decrements the underlying pointer by 1. More... | |
multi_ptr | operator-- (int) |
Decrements the underlying pointer by 1 and returns a new multi_ptr with the value of the previous pointer. More... | |
multi_ptr & | operator+= (difference_type r) |
Increments the underlying pointer by r. More... | |
multi_ptr | operator+ (difference_type r) const |
Creates a new multi_ptr that points r forward compared to *this. More... | |
multi_ptr & | operator-= (difference_type r) |
Decrements the underlying pointer by r. More... | |
multi_ptr | operator- (difference_type r) const |
Creates a new multi_ptr that points r backward compared to *this. More... | |
Protected Types | |
using | multi_ptr_base = detail::multi_ptr_base< dataType, asp > |
using | original_type_ref = typename detail::address_space_trait< dataType, asp >::original_type & |
using | original_type_cref = const typename detail::address_space_trait< dataType, asp >::original_type & |
using | non_const_data_t = typename std::remove_const< dataType >::type |
Alias to the non-const qualified data type. More... | |
using | void_conversion_t = typename std::conditional< std::is_const< dataType >::value, const void, void >::type |
A void type with const-ness matching the value_type of this pointer. More... | |
Detailed Description
template<typename dataType, cl::sycl::access::address_space asp>
class cl::sycl::multi_ptr< dataType, asp >
multi_ptr, generic pointer class.
This class have the same interface as the explicit pointer classes (global_ptr, private_ptr, local_ptr and constant_ptr). The address space where the data point to is defined by the template parameter Space. A cast operator allow the conversion from a multi_ptr object to its equivalent explicit one.
- Template Parameters
-
dataType Data type the object manipulates. asp The address space the pointer class points to.
Definition at line 518 of file multi_pointer.h.
Member Typedef Documentation
◆ difference_type
using cl::sycl::multi_ptr< dataType, asp >::difference_type = typename multi_ptr_base::difference_type |
Definition at line 559 of file multi_pointer.h.
◆ multi_ptr_base
|
protected |
Definition at line 520 of file multi_pointer.h.
◆ non_const_data_t
|
protected |
Alias to the non-const qualified data type.
Definition at line 529 of file multi_pointer.h.
◆ original_type_cref
|
protected |
Definition at line 525 of file multi_pointer.h.
◆ original_type_ref
|
protected |
Definition at line 523 of file multi_pointer.h.
◆ pointer [1/2]
using cl::sycl::multi_ptr< dataType, asp >::pointer = ptr_t |
Definition at line 561 of file multi_pointer.h.
◆ pointer [2/2]
using cl::sycl::multi_ptr< dataType, asp >::pointer = typename multi_ptr_base::const_pointer_t |
Definition at line 564 of file multi_pointer.h.
◆ reference [1/2]
using cl::sycl::multi_ptr< dataType, asp >::reference = typename multi_ptr_base::asp_type& |
Definition at line 549 of file multi_pointer.h.
◆ reference [2/2]
using cl::sycl::multi_ptr< dataType, asp >::reference = const typename multi_ptr_base::asp_type& |
Definition at line 555 of file multi_pointer.h.
◆ value_type
using cl::sycl::multi_ptr< dataType, asp >::value_type = typename multi_ptr_base::element_type |
Definition at line 558 of file multi_pointer.h.
◆ void_conversion_t
|
protected |
A void type with const-ness matching the value_type of this pointer.
Definition at line 700 of file multi_pointer.h.
Constructor & Destructor Documentation
◆ multi_ptr() [1/8]
|
default |
Default constructor.
◆ multi_ptr() [2/8]
|
inline |
Initialize the object using the given pointer.
- Parameters
-
ptr Pointer that the class should manipulate.
Definition at line 587 of file multi_pointer.h.
◆ multi_ptr() [3/8]
|
inline |
Copy constructor from a non-const multi_ptr.
- Template Parameters
-
COMPUTECPP_ENABLE_IF Only available when dataType is const
- Parameters
-
rhs Non-const multi_ptr
Definition at line 594 of file multi_pointer.h.
◆ multi_ptr() [4/8]
|
inline |
Copy constructor from a void multi_ptr.
- Parameters
-
rhs void multi_ptr
Definition at line 605 of file multi_pointer.h.
◆ multi_ptr() [5/8]
|
inline |
Copy constructor from a const void multi_ptr.
- Template Parameters
-
COMPUTECPP_ENABLE_IF Only available when dataType is const
- Parameters
-
rhs const void multi_ptr
Definition at line 620 of file multi_pointer.h.
◆ multi_ptr() [6/8]
|
inline |
Initialize the object using an accessor to non-const data.
- Template Parameters
-
dimensions Accessor dimensions Mode Accessor mode isPlaceholder Whether the accessor is a placeholder COMPUTECPP_ENABLE_IF This constructor is only available for access::address_space::global_space access::address_space::constant_space access::address_space::local_space. It is available regardless of dataType being const or not.
- Parameters
-
acc Accessor to retrieve the pointer from
Definition at line 639 of file multi_pointer.h.
◆ multi_ptr() [7/8]
|
inline |
Initialize the object using an accessor to const data.
- Template Parameters
-
dimensions Accessor dimensions Mode Accessor mode isPlaceholder Whether the accessor is a placeholder COMPUTECPP_ENABLE_IF This constructor is only available for access::address_space::global_space access::address_space::constant_space access::address_space::local_space. Available only if dataType is const.
- Parameters
-
acc Accessor to retrieve the pointer from
Definition at line 662 of file multi_pointer.h.
◆ multi_ptr() [8/8]
cl::sycl::multi_ptr< dataType, asp >::multi_ptr | ( | ptr_unqual_t | ptr | ) |
Initialize the object using the given non address space qualified pointer.
This conversion is defined by the device compiler.
- Template Parameters
-
COMPUTECPP_ENABLE_IF Only available if the provided pointer is not address space qualified.
- Parameters
-
ptr Pointer that is not address space qualified that the class should manipulate
- Note
- This constructor has to be declared in order for the offload device compiler to deduce address spaces, but it should not be defined because it should never actually be used in Offload. It is used in the ASP compiler, however.
Member Function Documentation
◆ COMPUTECPP_DEPRECATED_BY_SYCL_VER() [1/2]
|
inline |
- Parameters
-
i Index.
- Returns
- Reference to the i-th element the object points to.
- Deprecated:
- Use operator* or operator-> instead
Definition at line 725 of file multi_pointer.h.
◆ COMPUTECPP_DEPRECATED_BY_SYCL_VER() [2/2]
|
inline |
- Parameters
-
i Index.
- Returns
- Const reference to the i-th element the object points to.
- Deprecated:
- Use operator* or operator-> instead
Definition at line 735 of file multi_pointer.h.
◆ operator multi_ptr< void_conversion_t, asp >()
|
inline |
Implicit conversion to multi_ptr<(const) void>.
Const-ness matches value_type.
Definition at line 705 of file multi_pointer.h.
◆ operator*() [1/2]
|
inline |
- Returns
- Reference to the data the object points to.
Definition at line 715 of file multi_pointer.h.
◆ operator*() [2/2]
|
inline |
- Returns
- Const reference to the data the object points to.
Definition at line 719 of file multi_pointer.h.
◆ operator+()
|
inline |
Creates a new multi_ptr that points r forward compared to *this.
- Parameters
-
r Number of elements to increment the underlying pointer by
- Returns
- New multi_ptr object with the pointer advanced by r
Definition at line 793 of file multi_pointer.h.
◆ operator++() [1/2]
|
inline |
Increments the underlying pointer by 1.
- Returns
- This object
Definition at line 747 of file multi_pointer.h.
◆ operator++() [2/2]
|
inline |
Increments the underlying pointer by 1 and returns a new multi_ptr with the value of the previous pointer.
- Returns
- New multi_ptr object with the old pointer value
Definition at line 756 of file multi_pointer.h.
◆ operator+=()
|
inline |
Increments the underlying pointer by r.
- Parameters
-
r Number of elements to increment the underlying pointer by
- Returns
- This object
Definition at line 784 of file multi_pointer.h.
◆ operator-()
|
inline |
Creates a new multi_ptr that points r backward compared to *this.
- Parameters
-
r Number of elements to decrement the underlying pointer by
- Returns
- New multi_ptr object with the pointer moved back by r
Definition at line 810 of file multi_pointer.h.
◆ operator--() [1/2]
|
inline |
Decrements the underlying pointer by 1.
- Returns
- This object
Definition at line 765 of file multi_pointer.h.
◆ operator--() [2/2]
|
inline |
Decrements the underlying pointer by 1 and returns a new multi_ptr with the value of the previous pointer.
- Returns
- New multi_ptr object with the old pointer value
Definition at line 774 of file multi_pointer.h.
◆ operator-=()
|
inline |
Decrements the underlying pointer by r.
- Parameters
-
r Number of elements to decrement the underlying pointer by
- Returns
- This object
Definition at line 801 of file multi_pointer.h.
The documentation for this class was generated from the following file: