-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL] Added ext_oneapi_non_uniform_groups aspect
#10902
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
Changes from 8 commits
75fbe0f
fe5ab18
32961b5
d885fdd
06206f8
a59229b
ee5e1c2
a8e85aa
9ea80ca
fd2f62f
f75ab44
79df2ab
558c8d2
b34be0e
9c1f3a7
9546f8d
be657c9
03ca377
2be3514
07fda3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
gmlueck marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #include <sycl/aspects.hpp> | ||
| #include <sycl/detail/pi.h> // for PI_ERROR_INVALID_DEVICE | ||
| #include <sycl/detail/type_traits.hpp> // for is_group, is_user_cons... | ||
| #include <sycl/exception.hpp> // for runtime_error | ||
|
|
@@ -30,7 +31,13 @@ template <typename Group> | |
| inline std::enable_if_t<sycl::is_group_v<std::decay_t<Group>> && | ||
| std::is_same_v<Group, sycl::sub_group>, | ||
| ballot_group<Group>> | ||
| #ifdef __SYCL_DEVICE_ONLY__ | ||
| get_ballot_group [[__sycl_detail__::__uses_aspects__( | ||
| sycl::aspect::ext_oneapi_non_uniform_groups)]] (Group group, | ||
|
||
| bool predicate); | ||
| #else | ||
| get_ballot_group(Group group, bool predicate); | ||
| #endif | ||
|
|
||
| template <typename ParentGroup> class ballot_group { | ||
| public: | ||
|
|
@@ -142,6 +149,7 @@ inline std::enable_if_t<sycl::is_group_v<std::decay_t<Group>> && | |
| get_ballot_group(Group group, bool predicate) { | ||
| (void)group; | ||
| #ifdef __SYCL_DEVICE_ONLY__ | ||
| #if defined(__SPIR__) || defined(__NVPTX__) | ||
| // ballot_group partitions into two groups using the predicate | ||
| // Membership mask for one group is negation of the other | ||
| sub_group_mask mask = sycl::ext::oneapi::group_ballot(group, predicate); | ||
|
|
@@ -150,6 +158,7 @@ get_ballot_group(Group group, bool predicate) { | |
| } else { | ||
| return ballot_group<sycl::sub_group>(~mask, predicate); | ||
| } | ||
| #endif | ||
| #else | ||
| (void)predicate; | ||
| throw runtime_error("Non-uniform groups are not supported on host device.", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -546,6 +546,11 @@ bool device_impl::has(aspect Aspect) const { | |
| sizeof(pi_bool), &support, nullptr) == PI_SUCCESS; | ||
| return call_successful && support; | ||
| } | ||
| case aspect::ext_oneapi_non_uniform_groups: { | ||
| return (this->getBackend() == backend::ext_oneapi_level_zero) || | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Pennycook I also wanted to check that this correctly covers all the SPIRV cases: Are The only two backends supporting the spirv non uniform groups? Thanks
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these are the only two that we've tested, at least. I'm happy to leave this as it is for now -- if we can prove to ourselves later that things should run elsewhere, we can update the aspect. |
||
| (this->getBackend() == backend::opencl) || | ||
| (this->getBackend() == backend::ext_oneapi_cuda); | ||
| } | ||
| } | ||
| throw runtime_error("This device aspect has not been implemented yet.", | ||
| PI_ERROR_INVALID_DEVICE); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.