-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Add max work-group size kernel properties #14518
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
ldrumm
merged 30 commits into
intel:sycl
from
frasercrmck:sycl-max-wg-size-kernel-props
Sep 25, 2024
Merged
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
1cbe971
[SYCL] Add max work-group size kernel properties
frasercrmck b4d3bf1
feedback: total -> linear
frasercrmck a9b43f2
Update sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_proper…
frasercrmck cea3495
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 97cfa72
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck f0ab74c
feedback: maybe_unused; delete comment; update spec for exception wor…
frasercrmck 113db50
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck d6d2892
update llvm-spirv
frasercrmck fb88877
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 6ee833c
update tests
frasercrmck 7722aac
emit to program metadata; add tests
frasercrmck e970e1e
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 1c60be0
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 7a08488
test different backends
frasercrmck ada9cb8
fix formatting
frasercrmck e4e9272
Revert "test different backends"
frasercrmck d427d12
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck ea9c293
update tests
frasercrmck 5a2f3a6
add sycl runtime checking
frasercrmck 63a776b
fix ur link
frasercrmck 7c5ed9f
workaround unsupported
frasercrmck 2d2ce2b
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 91d632f
bump metadata size; bump UR
frasercrmck 97e6cc1
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck cadc81b
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 079948b
bump
frasercrmck 275c9ae
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 1594d8c
update docs
frasercrmck bb55883
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 4a40d12
Merge remote-tracking branch 'origin/sycl' into sycl-max-wg-size-kern…
frasercrmck 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
20 changes: 20 additions & 0 deletions
20
sycl/test/check_device_code/extensions/properties/properties_kernel_launch_bounds.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,20 @@ | ||
| // RUN: %clangxx -fsycl-device-only -S -Xclang -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK-IR | ||
| // RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s | ||
| // expected-no-diagnostics | ||
|
|
||
| #include <sycl/sycl.hpp> | ||
|
|
||
| int main() { | ||
| sycl::queue Q; | ||
|
|
||
| constexpr auto Props = sycl::ext::oneapi::experimental::properties{ | ||
| sycl::ext::oneapi::experimental::max_linear_work_group_size<4>, | ||
| }; | ||
| // CHECK-IR: spir_kernel void @{{.*}}LaunchBoundsKernel(){{.*}} #[[LaunchBoundsAttrs:[0-9]+]] | ||
| Q.single_task<class LaunchBoundsKernel>(Props, []() {}); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| // CHECK-IR: attributes #[[LaunchBoundsAttrs]] = { | ||
| // CHECK-IR-SAME: "sycl-max-linear-work-group-size"="4" |
24 changes: 24 additions & 0 deletions
24
sycl/test/check_device_code/extensions/properties/properties_kernel_launch_bounds_nvptx.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,24 @@ | ||
| // REQUIRES: cuda | ||
|
|
||
| // RUN: %clangxx -fsycl-device-only -fsycl-targets=nvptx64-nvidia-cuda -S -Xclang -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK-IR | ||
|
|
||
| #include <sycl/sycl.hpp> | ||
|
|
||
| int main() { | ||
| sycl::queue Q; | ||
|
|
||
| constexpr auto Props = sycl::ext::oneapi::experimental::properties{ | ||
| sycl::ext::oneapi::experimental::max_linear_work_group_size<4>, | ||
| }; | ||
|
|
||
| // CHECK-IR: define{{.*}}void @[[LaunchBoundsKernelFn:.*LaunchBoundsKernel0]](){{.*}} #[[LaunchBoundsAttrs:[0-9]+]] | ||
| Q.single_task<class LaunchBoundsKernel0>(Props, []() {}); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| // CHECK-IR: attributes #[[LaunchBoundsAttrs]] = { | ||
| // CHECK-IR-SAME: "sycl-max-linear-work-group-size"="4" | ||
|
|
||
| // CHECK-IR-DAG: !{ptr @[[LaunchBoundsKernelFn]], !"kernel", i32 1} | ||
| // CHECK-IR-DAG: !{ptr @[[LaunchBoundsKernelFn]], !"maxntidx", i32 4} |
37 changes: 37 additions & 0 deletions
37
sycl/test/check_device_code/extensions/properties/properties_kernel_max_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,37 @@ | ||
| // RUN: %clangxx -fsycl-device-only -S -Xclang -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK-IR | ||
| // RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s | ||
| // expected-no-diagnostics | ||
|
|
||
| #include <sycl/sycl.hpp> | ||
|
|
||
| int main() { | ||
| sycl::queue Q; | ||
| sycl::event Ev; | ||
|
|
||
| constexpr auto Props1 = sycl::ext::oneapi::experimental::properties{ | ||
| sycl::ext::oneapi::experimental::max_work_group_size<8>}; | ||
| constexpr auto Props2 = sycl::ext::oneapi::experimental::properties{ | ||
| sycl::ext::oneapi::experimental::max_work_group_size<8, 4>}; | ||
| constexpr auto Props3 = sycl::ext::oneapi::experimental::properties{ | ||
| sycl::ext::oneapi::experimental::max_work_group_size<8, 4, 2>}; | ||
|
|
||
| // CHECK-IR: spir_kernel void @{{.*}}MaxWGSizeKernel0(){{.*}} #[[MaxWGSizeAttr0:[0-9]+]] | ||
| // CHECK-IR-SAME: !max_work_group_size ![[MaxWGSizeMD0:[0-9]+]] | ||
| Q.single_task<class MaxWGSizeKernel0>(Props1, []() {}); | ||
| // CHECK-IR: spir_kernel void @{{.*}}MaxWGSizeKernel1(){{.*}} #[[MaxWGSizeAttr1:[0-9]+]] | ||
| // CHECK-IR-SAME: !max_work_group_size ![[MaxWGSizeMD1:[0-9]+]] | ||
| Q.single_task<class MaxWGSizeKernel1>(Ev, Props2, []() {}); | ||
| // CHECK-IR: spir_kernel void @{{.*}}MaxWGSizeKernel2(){{.*}} #[[MaxWGSizeAttr2:[0-9]+]] | ||
| // CHECK-IR-SAME: !max_work_group_size ![[MaxWGSizeMD2:[0-9]+]] | ||
| Q.single_task<class MaxWGSizeKernel2>({Ev}, Props3, []() {}); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| // CHECK-IR: attributes #[[MaxWGSizeAttr0]] = { {{.*}}"sycl-max-work-group-size"="8" | ||
| // CHECK-IR: attributes #[[MaxWGSizeAttr1]] = { {{.*}}"sycl-max-work-group-size"="8,4" | ||
| // CHECK-IR: attributes #[[MaxWGSizeAttr2]] = { {{.*}}"sycl-max-work-group-size"="8,4,2" | ||
|
|
||
| // CHECK-IR: ![[MaxWGSizeMD0]] = !{i64 8} | ||
| // CHECK-IR: ![[MaxWGSizeMD1]] = !{i64 4, i64 8} | ||
| // CHECK-IR: ![[MaxWGSizeMD2]] = !{i64 2, i64 4, i64 8} |
Oops, something went wrong.
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.