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] Implement span support for sycl::reduction #5941

Closed
jasonsewall-intel opened this issue Mar 31, 2022 · 0 comments · Fixed by #6019
Closed

[SYCL] Implement span support for sycl::reduction #5941

jasonsewall-intel opened this issue Mar 31, 2022 · 0 comments · Fixed by #6019
Labels
confirmed enhancement New feature or request

Comments

@jasonsewall-intel
Copy link

SYCL 2020 rev. 4 specifies that SYCL should accept span for array reductions here, but it isn't currently supported.

For example, I think the following code should work:

int *histogram = sycl::malloc_shared<int>(16,q);
q.submit([&](sycl::handler &h) {
  h.parallel_for(sycl::range<1>(N),
                 sycl::reduction(sycl::span<int>(histogram,16), std::plus<>()),
                 [=](sycl::id<1> i, auto &histo) {
                         histo[i%16] += 1;
                 });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants