-
Notifications
You must be signed in to change notification settings - Fork 772
[SYCL] Add runtime support for fsycl-id-queries-fit-in-int #1685
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
19 commits
Select commit
Hold shift + click to select a range
383e91c
[SYCL] Add runtime support for fsycl-id-queries-fit-in-int
12befcd
React to comments
15ee91c
Merge branch 'sycl' into private/abatashe/id_fit_int
37c0f6c
[SYCL] Add and use __SYCL_ASSUME_ARRAY_INT and __SYCL_ASSUME_ID_INT
c7e17d8
[SYCL] Fix style issue
f24aa75
[SYCL] Add ALWAYS_INLINE
b5f053c
[SYCL] Add checks
1849bfd
[SYCL] Run FileCheck
d2feeb6
[SYCL] Fix style issue.
cee60be
Merge branch 'sycl' into private/abatashe/id_fit_int
cbc5e69
[SYCL] Remove unwanted changes.
e334ad8
[SYCL] Add assume in size_t conversion operator
fa31f52
[SYCL] Add ALWAYS_INLINE
a8d44f5
[SYCL] Move test
abd3482
[SYCL] Add warning
53f4dbb
[SYCL] Reword warning
s-kanaev 1ee97f2
[SYCL] Use a safer version of macro.
s-kanaev 22c4c48
[SYCL] Remove unwanted change
65b9a41
[SYCL] Fix style issue
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// RUN: %clangxx -fsycl -Xclang -fsycl-is-host -O1 -c -S -emit-llvm -o %t.ll -D__SYCL_ID_QUERIES_FIT_IN_INT__=1 %s | ||
// RUN: FileCheck %s --input-file %t.ll | ||
|
||
#include <CL/sycl.hpp> | ||
|
||
using namespace sycl; | ||
|
||
// CHECK: define dso_local i32 @main() {{.*}} { | ||
int main() { | ||
item<1, true> TestItem = detail::Builder::createItem<1, true>({3}, {2}, {1}); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int Id = TestItem.get_id(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int Range = TestItem.get_range(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int LinearId = TestItem.get_linear_id(); | ||
|
||
cl::sycl::nd_item<1> TestNDItem = | ||
detail::Builder::createNDItem<1>(detail::Builder::createItem<1, false>({4}, {2}), | ||
detail::Builder::createItem<1, false>({2}, {0}), | ||
detail::Builder::createGroup<1>({4}, {2}, {1})); | ||
|
||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int GlobalId = TestNDItem.get_global_id(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int GlobalLinearId = TestNDItem.get_global_linear_id(); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int LocalId = TestNDItem.get_local_id(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int LocalLinearId = TestNDItem.get_local_linear_id(); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int GroupRange = TestNDItem.get_group_range(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int GroupId = TestNDItem.get_group(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int GroupLinearId = TestNDItem.get_group_linear_id(); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int GlobalRange = TestNDItem.get_global_range(0); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int LocalRange = TestNDItem.get_local_range(0); | ||
|
||
int GlobalIdConverted = TestNDItem.get_global_id(); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int LocalIdConverted = TestNDItem.get_local_id(); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
int OffsetConferted = TestNDItem.get_offset(); | ||
// CHECK: call void @llvm.assume(i1 {{.*}}) | ||
|
||
return 0; | ||
} | ||
// CHECK: } |
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.