sycl::id#
template <int Dimensions = 1>
class id;
The sycl::id class is a collection of size Dimensions that is used
to represent an id into a global or local sycl::range.
It can be used as an index in an accessor of the same rank.
The subscript operator (operator[](n)) returns the
component n as a size_t.
See also
SYCL Specification Section 4.9.1.3
(constructors)#
id();
Construct an id with the value 0 for each dimension
id(size_t dim0);
Construct a 1D id with value dim0.
Only available if Dimensions is equals to 1.
id(size_t dim0, size_t dim1);
Construct a 2D id with value dim0 and dim1.
Only available if Dimensions is equals to 2.
id(size_t dim0, size_t dim1, size_t dim2);
Construct a 3D id with value dim0, dim1 and dim2.
Only available if Dimensions is equals to 3.
id(const sycl::range<Dimensions>& range);
Construct an id from a sycl::range
using dimensions of range.
id(const sycl::item<Dimensions>& item);
Construct an id from a sycl::item using the sycl::id
contained in the sycl::item.
Member functions#
get#
size_t get(int dimension) const;
Return the value of the sycl::id for dimension dimension.
size_t& operator[]#
size_t& operator[](int dimension);
Return a reference to the requested dimension of the sycl::id object.
size_t operator[]#
size_t operator[](int dimension) const;
Return the value of the requested dimension of the sycl::id object.
operator size_t() const#
operator size_t() const;
Available only when: Dimensions == 1
Returns the same value as get(0).