KhronosGroup / KhronosGroup/SYCL-Docs

Can "item" and "nd_item" be shared across work-items?

Open
#532 6 comments 0 reactions 0 assignees View on GitHub
clarification
Dominant language
JavaScript
Stars
158
Forks
80
Avg merge
7d 6h
Merged PRs (30d)
5

Description

This question recently came up from our implementation team. What is the precise semantics of the member functions on `item` and `nd_item`? Do they return the index of the *calling* work-item or do they return the index of the work-item that created the object?

The question is relevant only in the weird case where an `item` or `nd_item` object from one work-item is copied into SLM and then referenced by another work-item. This could be done, for example, by using placement-new to copy the `item` or `nd_item` object.

Note that `id` may have a different semantic because it is user-constructible. The semantics of `id` seem clear. The member functions return the information that was used to construct the `id` object. Therefore, if work-item _A_ copies its `id` object to SLM and then another work-item _B_ calls its member functions, I presume work-item _B_ would get the index of work-item _A_.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the SYCL specification text that defines the member functions of item, nd_item, and id, along with the described copying into SLM. Done means the specification records precise semantics for calls through copied item and nd_item objects and distinguishes them from user-constructed id objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.