Skip to content
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

[SYCL] Restrict nd_range parallel_for to nd_item #11067

Merged

Conversation

steffenlarsen
Copy link
Contributor

According to the SYCL 2020 specification:

The function object that represents the SYCL kernel function must take
one of: 1) a single SYCL nd_item parameter, 2) a single generic parameter (template parameter or auto) that will be treated as an nd_item parameter, 3) any other type converted from SYCL nd_item, representing the currently executing work-item within the range specified by the nd_range parameter.

However, the current implementation allows also sycl::item and any argument types convertible from a sycl::item. This commit addresses this discrepancy by disallowing anything other than sycl::nd_item and all types convertible from sycl::nd_item in this kind of parallel_for. Since this may break existing code, this new restriction is guarded by the SYCL2020_CONFORMANT_APIS preprocessor macro.

According to the SYCL 2020 specification:

> The function object that represents the SYCL kernel function must take
one of: 1) a single SYCL nd_item parameter, 2) a single generic
parameter (template parameter or auto) that will be treated as an
nd_item parameter, 3) any other type converted from SYCL nd_item,
representing the currently executing work-item within the range
specified by the nd_range parameter.

However, the current implementation allows also sycl::item and any
argument types convertible from a sycl::item. This commit addresses this
discrepancy by disallowing anything other than sycl::nd_item and all
types convertible from sycl::nd_item in this kind of parallel_for. Since
this may break existing code, this new restriction is guarded by the
SYCL2020_CONFORMANT_APIS preprocessor macro.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
sycl/include/sycl/handler.hpp Outdated Show resolved Hide resolved
Co-authored-by: Alexey Bader <alexey.bader@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants