Skip to content

[SYCL] Allow group algorithms to accept a function object with an explicit type #9784

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

Merged
merged 2 commits into from
Jun 20, 2023

Conversation

jzc
Copy link
Contributor

@jzc jzc commented Jun 8, 2023

This PR also removes unnecessary special cases for half in the static assertions of the group algorithms (and adds corresponding tests for them) and refactors the reduce_sycl2020.cpp, inclusive_scan_sycl2020.cpp, and exclusive_scan_sycl2020.cpp tests a bit.

@jzc jzc requested a review from a team as a code owner June 8, 2023 01:15
@jzc jzc requested a review from sergey-semenov June 8, 2023 01:15
@jzc jzc temporarily deployed to aws June 8, 2023 01:33 — with GitHub Actions Inactive
@jzc jzc temporarily deployed to aws June 8, 2023 02:11 — with GitHub Actions Inactive
@jzc jzc temporarily deployed to aws June 8, 2023 05:32 — with GitHub Actions Inactive
@jzc jzc temporarily deployed to aws June 8, 2023 06:41 — with GitHub Actions Inactive
using type = F<T>;
};

template <template <typename> typename F> struct get_scalar_binary_op<F<void>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this template specialization needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle the function types without an explicit argument, e.g. in a case like reduce_over_group(g, int2{}, sycl::plus<>()), we will be instantiating get_scalar_binary_op with sycl::plus<void> (= sycl::plus<>) , which does not match the other partial specialization, so we need this to compile correctly.

@AlexeySachkov
Copy link
Contributor

@intel/sycl-language-enabling-triage: FYI

@sergey-semenov, @intel/llvm-reviewers-runtime, could you please take a look?

@AlexeySachkov AlexeySachkov merged commit 78f09e6 into intel:sycl Jun 20, 2023
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.

4 participants