-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Clarify sub-group size calculation in invoke_simd spec. #6587
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
Conversation
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
|
@rolandschulz, friendly ping |
|
We can add a note describing a possible algorithm. But we have to fix the normative part. The normative description regarding size-calculation is at line 126: The first sentence is wrong because it ignores the return value. I think it needs be changed to: I think the 2nd sentence is wrong (or at least unclear). It is fine if all but one or Unrelated to the size calculation the wording "SIMD function" could be confusing. The intention is clearly that we don't just mean function (pointers). Because starting on line 166 we clarify what BTW: The sentence "Callable may be a function object, a lambda, or a function pointer" is also a bit weird. A lambda and a function pointer is a function object (http://eel.is/c++draft/function.objects#general-1). |
|
My suggestion for the first sentence was still incorrect. It ignored that only those mapped from non-uniform arguments matter. It might need to be: "The value of |
sycl/doc/extensions/experimental/sycl_ext_oneapi_invoke_simd.asciidoc
Outdated
Show resolved
Hide resolved
…sciidoc Co-authored-by: rolandschulz <roland.schulz@intel.com>
this is not quite accurate, I believe. Implementation rather uses the |
|
One more minor gap. We admit we can use We should add a return type conversion rule specific to the |
|
@rolandschulz, @Pennycook, friendly ping |
| Otherwise, the SIMD function cannot be invoked from an SPMD kernel and the | ||
| implementation must issue a diagnostic in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is now inconsistent with the description on lines 283-294. The text here implies that it's illegal to invoke a fully uniform function, and I prefer the description that comes later. Do we need to duplicate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the two 'if's in the above bullets put requirements under two separate conditions, and if no conditions hold, then requirements are not imposed, and fully uniform can be called.
The lines 132-133 just try to tell what happens if the "must" requirement above does not hold, so I think this should remain in some form - ? I'll try to reformulate.
| Each of the following must hold true for a SIMD function and its invoke_simd | ||
| call site: | ||
| - the value of `N` of each `simd` formal parameter corresponding to a non-uniform | ||
| SPMD actual argument (if any) must be the same | ||
| - if the return type of the SIMD function is `simd<T, M>` or `simd_mask<T, M>`, | ||
| then `M` must match `N` above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Each of the following must hold true for a SIMD function and its invoke_simd | |
| call site: | |
| - the value of `N` of each `simd` formal parameter corresponding to a non-uniform | |
| SPMD actual argument (if any) must be the same | |
| - if the return type of the SIMD function is `simd<T, M>` or `simd_mask<T, M>`, | |
| then `M` must match `N` above | |
| If there are non-uniform actual arguments in `invoke_simd` call site, then each of the following must hold true for the call site and the target SIMD function: | |
| - the value of `N` of each `simd` formal parameter corresponding to a non-uniform | |
| SPMD actual argument (if any) must be the same | |
| - if the return type of the SIMD function is `simd<T, M>` or `simd_mask<T, M>`, | |
| then `M` must match `N` above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pennycook, does the above change resolve your concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, LGTM.
Signed-off-by: Konstantin S Bobrovsky konstantin.s.bobrovsky@intel.com