cl::sycl::item< dimensions, with_offset > Class Template Reference
The cl::sycl::item object is a container for all information about a work item. More...
#include <base.h>
Public Member Functions | |
item (const item &rhs)=default | |
Copy constructor. More... | |
item (const detail::item_base &itemBase) | |
size_t | get_range (int dimension) const |
Gets the global range in a specified dimension if provided by a handler::parallel_for and gets the local range in a specified dimension if provided by a parallel_for_work_item. More... | |
range< dimensions > | get_range () const |
Get the global range of the enqueued kernel if provided by a handler::parallel_for. More... | |
template<COMPUTECPP_ENABLE_IF(offset_t, with_offset) > | |
id< dimensions > | get_offset () const |
Get the invocation offset. More... | |
size_t | get_id (int dimension) const |
Get the id for a specific dimension. More... | |
id< dimensions > | get_id () const |
Get the id associated with this item for all dimensions. More... | |
template<class sfinae = offset_t> | |
operator detail::enable_if_t< has_no_offset< sfinae > () | |
Returns an item representing the same information as the object holds but also includes the offset set to 0. More... | |
item () const | |
Friends | |
bool | operator== (const item &lhs, const item &rhs) |
Equality operator. More... | |
bool | operator!= (const item &lhs, const item &rhs) |
Non-equality operator. More... | |
Detailed Description
template<int dimensions = 1, bool with_offset = true>
class cl::sycl::item< dimensions, with_offset >
The cl::sycl::item object is a container for all information about a work item.
The cl::sycl::item object is used within the handler::parallel_for and parallel_for_work_item functions. The cl::sycl::item object can return information about the local and global sizes of an enqueued nd_range as well as the local and global ids of the work item. item<dimensions> is a derived class of detail::item_base, which is a non-templated class implementing most of the functionality of cl::sycl::item<dimensions>.
- Template Parameters
-
dimensions Number of dimensions of the item object with_offset Whether the object contains an offset or not
Constructor & Destructor Documentation
◆ item() [1/3]
|
default |
Copy constructor.
Create a copy of another item object.
◆ item() [2/3]
|
inline |
◆ item() [3/3]
|
inline |
Member Function Documentation
◆ get_id() [1/2]
|
inline |
◆ get_id() [2/2]
|
inline |
Get the id associated with this item for all dimensions.
- Returns
- The global id if the item is provided by a handler::parallel_for. The local id if the item is provided by a parallel_for_work_item.
◆ get_offset()
|
inline |
◆ get_range() [1/2]
|
inline |
Gets the global range in a specified dimension if provided by a handler::parallel_for and gets the local range in a specified dimension if provided by a parallel_for_work_item.
- Parameters
-
dimension The dimension of the range to retrieve.
- Returns
- The value of the global range in the dimension specified.
◆ get_range() [2/2]
|
inline |
Get the global range of the enqueued kernel if provided by a handler::parallel_for.
Get the local range if used if provided by a parallel_for_work_item.
- Returns
- the values of the global range for all dimensions.
◆ operator detail::enable_if_t< has_no_offset< sfinae >()
cl::sycl::item< dimensions, with_offset >::operator detail::enable_if_t< has_no_offset< sfinae > | ( | ) |
Returns an item representing the same information as the object holds but also includes the offset set to 0.
- Template Parameters
-
sfinae Dummy type to signal that this conversion is only available if with_offset is false
- Returns
- This object with an offset added
Friends And Related Function Documentation
◆ operator!=
◆ operator==
The documentation for this class was generated from the following files: