-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Improve handling of large reqd_work_group_size values #10620
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4b241e6
[SYCL] Improve handling of large reqd_sub_group_size values
jzc 0bde9ff
clang-format
jzc 504002b
Remove iostream include
jzc 43bd4e8
Remove unused variable
jzc 64196de
Merge remote-tracking branch 'intel/sycl' into work-group-size-exception
jzc 644bbca
Address some review comments
jzc 1137476
Add reqd_work_group_size_size_t
jzc 205b26e
Merge remote-tracking branch 'intel/sycl' into work-group-size-exception
jzc 5d0f425
Remove ifndef
jzc acac6e6
Allow for PropertyValue to be constructed from other containers
jzc 3a2d676
Use fixed sized integers
jzc 0ed23fd
Disable for hip
jzc 5d4620a
Update comment and change variable name
jzc febffa0
clang-format
jzc 1fce9c5
Merge remote-tracking branch 'intel/sycl' into work-group-size-exception
jzc 12acd6f
Use numeric_limits
jzc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
sycl/test-e2e/OptionalKernelFeatures/large-reqd-work-group-size.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// UNSUPPORTED: hip | ||
// RUN: %{build} -o %t.out -fno-sycl-id-queries-fit-in-int | ||
// RUN: %{run} %t.out | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
using namespace sycl; | ||
queue q; | ||
int n_fail = 0; | ||
|
||
template <typename FunctorT> | ||
void throws_kernel_not_supported(const char *test_name, FunctorT f) { | ||
try { | ||
f(); | ||
} catch (const sycl::exception &e) { | ||
if (e.code() != errc::kernel_not_supported) { | ||
std::cout << "fail: " << test_name << "\n" | ||
<< "Caught wrong exception with error code " << e.code() << "\n" | ||
<< e.what() << "\n"; | ||
++n_fail; | ||
return; | ||
} else { | ||
std::cout << "pass: " << test_name << "\n" | ||
<< "Caught right exception:\n" | ||
<< e.what() << "\n"; | ||
return; | ||
} | ||
} | ||
std::cout << "fail: " << test_name << "\n" | ||
<< "No exception thrown\n"; | ||
++n_fail; | ||
return; | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
throws_kernel_not_supported("nd_range<1>", [] { | ||
constexpr uint32_t N = std::numeric_limits<uint32_t>::max(); | ||
q.parallel_for<class K0>(nd_range<1>(N, N), | ||
[=](auto) [[sycl::reqd_work_group_size(N)]] {}); | ||
}); | ||
|
||
throws_kernel_not_supported("nd_range<2>", [] { | ||
constexpr uint32_t N = std::numeric_limits<uint32_t>::max(); | ||
q.parallel_for<class K1>(nd_range<2>({N, N}, {N, N}), | ||
[=](auto) [[sycl::reqd_work_group_size(N, N)]] {}); | ||
}); | ||
|
||
throws_kernel_not_supported("nd_range<3>", [] { | ||
constexpr uint32_t N = std::numeric_limits<uint32_t>::max(); | ||
q.parallel_for<class K2>(nd_range<3>({N, N, N}, {N, N, N}), | ||
[=](auto) | ||
[[sycl::reqd_work_group_size(N, N, N)]] {}); | ||
}); | ||
|
||
throws_kernel_not_supported("uint32_max+2", [] { | ||
constexpr uint64_t N = std::numeric_limits<uint32_t>::max() + uint64_t(2); | ||
q.parallel_for<class K3>(nd_range<1>(N, N), | ||
[=](auto) [[sycl::reqd_work_group_size(N)]] {}); | ||
}); | ||
|
||
return n_fail; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.