-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Add missing reduction parallel_for shortcuts to queue #6070
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] Add missing reduction parallel_for shortcuts to queue #6070
Conversation
These changes add the missing parallel_for shortcuts with the variadic parameters containing reduction operations and a kernel functor or lambda. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
/verify with intel/llvm-test-suite#1010 |
This PR is similar to existing one: #4352 |
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 have couple comments, see below.
Also, this PR duplicates the work done in #4352, which I hoped to merge soon after getting review from @tovinkere
/// \param Rest is a parameter pack argument of size N where N > 1 and the | ||
/// first N-1 arguments are reduction operations and the last argument is a | ||
/// kernel functor or lambda. | ||
template <typename KernelName = detail::auto_name, int Dims, |
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.
Here the more general implementation is add, i.e. the one that accepts 'range' instead of having 3 different: 1 for range<1>, one for range<2>, and 3rd for range<3>.
Such split was done on purpose to allow conversions from int scalar: 4009b8b
(sizeof...(RestT) > 1 && | ||
ext::oneapi::detail::AreAllButLastReductions<RestT...>::value), | ||
event> | ||
parallel_for(range<Dims> NumWorkItems, RestT... Rest) { |
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.
SYCL 2020 SPEC says it should be 'RestT&&... Rest'
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.
You're absolutely right, though we do not have that in the handler parallel_for
implementation so it made sense to me to keep the signatures the same and migrate at the same time. Either is probably fine.
These changes add the missing parallel_for shortcuts with the variadic parameters containing reduction operations and a kernel functor or lambda.