DPC++ Runtime
Runtime libraries for oneAPI DPC++
|
|
Go to the documentation of this file.
24 #include <type_traits>
36 template <
int dimensions = 1>
class nd_item {
43 size_t Id = globalItem.get_id(dimension);
49 size_t Id = globalItem.get_linear_id();
57 size_t Id = localItem.get_id(dimension);
63 size_t Id = localItem.get_linear_id();
73 size_t Size = Group[dimension];
79 size_t Id = Group.get_linear_id();
87 size_t Range = Group.get_group_range(dimension);
95 return globalItem.get_range(dimension);
101 return localItem.get_range(dimension);
105 id<dimensions> get_offset()
const {
return globalItem.get_offset(); }
113 access::fence_space::global_and_local)
const {
121 template <access::mode accessMode = access::mode::read_write>
125 accessMode == access::
mode::write ||
126 accessMode == access::
mode::read_write,
128 accessSpace = access::
fence_space::global_and_local)
const {
133 template <
typename dataT>
136 size_t numElements)
const {
137 return Group.async_work_group_copy(dest, src, numElements);
140 template <
typename dataT>
143 size_t numElements)
const {
144 return Group.async_work_group_copy(dest, src, numElements);
147 template <
typename dataT>
150 size_t srcStride)
const {
152 return Group.async_work_group_copy(dest, src, numElements, srcStride);
155 template <
typename dataT>
158 size_t destStride)
const {
159 return Group.async_work_group_copy(dest, src, numElements, destStride);
162 template <
typename... eventTN>
void wait_for(eventTN... events)
const {
163 Group.wait_for(events...);
175 return (rhs.localItem == this->localItem) &&
176 (rhs.globalItem == this->globalItem) && (rhs.Group == this->Group);
185 : globalItem(GL), localItem(L), Group(GR) {}
196 #ifdef __SYCL_DEVICE_ONLY__
199 throw sycl::exception(
201 "Free function calls are not supported on host");
205 namespace ext::oneapi::experimental {
207 #ifdef __SYCL_DEVICE_ONLY__
208 return sycl::detail::Builder::getElement(
211 throw sycl::exception(
213 "Free function calls are not supported on host");
signed char __SYCL2020_DEPRECATED
Encapsulates a single SYCL device event which is available only within SYCL kernel functions and can ...
id< dimensions > get_global_id() const
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
__SYCL_CONVERGENT__ __DPCPP_SYCL_EXTERNAL void __spirv_ControlBarrier(__spv::Scope Execution, __spv::Scope Memory, uint32_t Semantics) noexcept
#define __SYCL_INLINE_VER_NAMESPACE(X)
range< dimensions > get_local_range() const
#define __SYCL_ALWAYS_INLINE
bool operator==(const nd_item &rhs) const
---— Error handling, matching OpenCL plugin semantics.
nd_range< dimensions > get_nd_range() const
device_event async_work_group_copy(global_ptr< dataT > dest, local_ptr< dataT > src, size_t numElements) const
size_t __SYCL_ALWAYS_INLINE get_global_linear_id() const
A unique identifier of an item in an index space.
device_event async_work_group_copy(global_ptr< dataT > dest, local_ptr< dataT > src, size_t numElements, size_t destStride) const
#define __SYCL_DEPRECATED(message)
group< dimensions > get_group() const
typename std::enable_if< B, T >::type enable_if_t
void barrier(access::fence_space accessSpace=access::fence_space::global_and_local) const
Defines the iteration domain of either a single work-group in a parallel dispatch,...
size_t __SYCL_ALWAYS_INLINE get_global_id(int dimension) const
Provides constructors for address space qualified and non address space qualified pointers to allow i...
Identifies an instance of the function object executing at each point in an nd_range.
size_t get_global_range(int dimension) const
Identifies an instance of the function object executing at each point in a range.
device_event async_work_group_copy(local_ptr< dataT > dest, global_ptr< dataT > src, size_t numElements) const
annotated_arg & operator=(annotated_arg &)=default
sub_group get_sub_group() const
void wait_for(eventTN... events) const
Defines the iteration domain of both the work-groups and the overall dispatch.
id< dimensions > get_local_id() const
size_t __SYCL_ALWAYS_INLINE get_group_range(int dimension) const
size_t __SYCL_ALWAYS_INLINE get_group(int dimension) const
#define __SYCL_ASSUME_INT(x)
size_t __SYCL_ALWAYS_INLINE get_local_id(int dimension) const
size_t get_local_range(int dimension) const
nd_item< Dims > this_nd_item()
size_t get_local_linear_id() const
size_t __SYCL_ALWAYS_INLINE get_group_linear_id() const
device_event async_work_group_copy(local_ptr< dataT > dest, global_ptr< dataT > src, size_t numElements, size_t srcStride) const
nd_item(const item< dimensions, true > &GL, const item< dimensions, false > &L, const group< dimensions > &GR)
bool operator!=(const nd_item &rhs) const
constexpr __spv::MemorySemanticsMask::Flag getSPIRVMemorySemanticsMask(memory_order)
range< dimensions > get_global_range() const
range< dimensions > get_group_range() const