-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can "item" and "nd_item" be shared across work-items? #532
Comments
Linking #451 here. |
I don't think these classes are meaningful outside of their own work item, because they generally carry the semantics of "give me the position of this item in the parallel iteration space". Using objects from a different work item should be illegal and/or UB. If one did this, even just within one implementation the behavior might not be consistent. For example, whether AdaptiveCpp stores the position in the iteration space inside |
I think this makes sense also. I was wondering why we didn't define all the member functions of In any case, I think we could add text to the introduction for each of these objects something like:
I think we could use similar language for |
I agree that freedom of implementation is important. But I think it may also be important to note that if the functions were static, a developer wouldn't need an instance of an |
Discussed in WG meeting 01/25/24. |
This change allows stateless nd_item implementation as discussed in KhronosGroup/SYCL-Docs#532. The list of changes includes removal of checks which compare nd_teams shared between work-items or on the host. Now test checks equality only on device within single work-item.
This change allows stateless nd_item implementation as discussed in KhronosGroup/SYCL-Docs#532. The list of changes includes removal of checks which compare nd_teams shared between work-items or on the host. Now test checks equality only on device within single work-item.
This change allows stateless nd_item implementation as discussed in KhronosGroup/SYCL-Docs#532. The list of changes includes removal of checks which compare nd_teams shared between work-items or on the host. Now test checks equality only on device within single work-item.
The problem with removed code is that it compares nd_item "states" obtained by calling methods like get_local_id() on the host. The discussion in KhronosGroup/SYCL-Docs#532 clarfies that these methods are supposed to return meaningful values from the kernel code only. nd_item constructors are tested in device code, so this change do not reduce feature coverage.
FYI. I committed stateless implementation of
As it was agreed above sharing and comparing stateless
KhronosGroup/SYCL-CTS#869 updates both tests. |
This question recently came up from our implementation team. What is the precise semantics of the member functions on
item
andnd_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
ornd_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 theitem
ornd_item
object.Note that
id
may have a different semantic because it is user-constructible. The semantics ofid
seem clear. The member functions return the information that was used to construct theid
object. Therefore, if work-item A copies itsid
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.The text was updated successfully, but these errors were encountered: