-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL] reqd_work_group_size attribute is reversed #1234
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
romanovvlad
merged 17 commits into
intel:sycl
from
fadeeval:private/fadeeval/reqd_work_group_size
Mar 10, 2020
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2fc939b
[SYCL] reqd_work_group_size attribute is reversed
fadeeval 3582e97
[SYCL] reqd_work_group_size attribute is reversed (fix #2)
fadeeval 3c6ea83
[SYCL] reqd_work_group_size attribute is reversed (fixed #3)
fadeeval b14013d
[SYCL] reqd_work_group_size attribute is reversed (fix #4)
fadeeval 1d0d751
[SYCL] reqd_work_group_size attribute is reversed (fix #5)
fadeeval ff6746a
[SYCL] reqd_work_group_size attribute is reversed (fix #6)
fadeeval 245f323
[SYCL] reqd_work_group_size attribute is reversed (fix #6)
fadeeval 9125bc1
[SYCL] reqd_work_group_size attribute is reversed (fix #8)
fadeeval a7eef4b
[SYCL] reqd_work_group_size attribute is reversed (fix #9)
fadeeval 2b6df01
[SYCL] reqd_work_group_size attribute is reversed (fix #10)
fadeeval 5c3501f
[SYCL] reqd_work_group_size attribute is reversed (fix #11)
fadeeval 43f265f
[SYCL] reqd_work_group_size attribute is reversed (fix #12)
fadeeval 5831eb4
[SYCL] reqd_work_group_size attribute is reversed (fix #13)
fadeeval 8696f6e
[SYCL] reqd_work_group_size attribute is reversed (fix #13)
fadeeval dc704bf
[SYCL] reqd_work_group_size attribute is reversed (fix #14)
fadeeval 9ab8cf7
[SYCL] reqd_work_group_size attribute is reversed
fadeeval abe6d2d
[SYCL] reqd_work_group_size attribute is reversed (fix #15)
fadeeval 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 |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
class Functor { | ||
public: | ||
[[cl::reqd_work_group_size(4, 1, 1)]] void operator()() {} | ||
|
||
}; | ||
|
||
template <typename name, typename Func> | ||
|
@@ -24,25 +23,33 @@ void bar() { | |
// expected-note@-1 {{conflicting attribute is here}} | ||
[[cl::reqd_work_group_size(32, 1, 1)]] void f32x1x1() {} // expected-note {{conflicting attribute is here}} | ||
|
||
[[cl::reqd_work_group_size(16, 1, 1)]] void f16x1x1() {} // expected-note {{conflicting attribute is here}} | ||
[[cl::reqd_work_group_size(16, 1, 1)]] void f16x1x1() {} // expected-note {{conflicting attribute is here}} | ||
[[cl::reqd_work_group_size(16, 16, 1)]] void f16x16x1() {} // expected-note {{conflicting attribute is here}} | ||
|
||
[[cl::reqd_work_group_size(32, 32, 1)]] void f32x32x1() {} // expected-note {{conflicting attribute is here}} | ||
[[cl::reqd_work_group_size(32, 32, 1)]] void f32x32x1() {} // expected-note {{conflicting attribute is here}} | ||
[[cl::reqd_work_group_size(32, 32, 32)]] void f32x32x32() {} // expected-note {{conflicting attribute is here}} | ||
|
||
class Functor16 { | ||
public: | ||
[[cl::reqd_work_group_size(16, 1, 1)]] void operator()() {} | ||
[[cl::reqd_work_group_size(16, 1, 1)]] [[cl::reqd_work_group_size(16, 1, 1)]] void operator()() {} | ||
Comment on lines
-35
to
+34
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. This is a new one. |
||
}; | ||
|
||
#ifdef TRIGGER_ERROR | ||
class Functor32 { | ||
public: | ||
//expected-warning@+2{{attribute 'reqd_work_group_size' is already applied with different parameters}} | ||
// expected-error@+1{{'reqd_work_group_size' attribute conflicts with 'reqd_work_group_size' attribute}} | ||
[[cl::reqd_work_group_size(32, 1, 1)]] [[cl::reqd_work_group_size(1, 1, 32)]] void operator()() {} | ||
}; | ||
#endif | ||
class Functor16x16x16 { | ||
public: | ||
[[cl::reqd_work_group_size(16, 16, 16)]] void operator()() {} | ||
}; | ||
|
||
class Functor8 { // expected-error {{conflicting attributes applied to a SYCL kernel}} | ||
public: | ||
[[cl::reqd_work_group_size(8, 1, 1)]] void operator()() { // expected-note {{conflicting attribute is here}} | ||
[[cl::reqd_work_group_size(1, 1, 8)]] void operator()() { // expected-note {{conflicting attribute is here}} | ||
f4x1x1(); | ||
} | ||
}; | ||
|
@@ -77,15 +84,17 @@ void bar() { | |
FunctorAttr fattr; | ||
kernel<class kernel_name4>(fattr); | ||
|
||
kernel<class kernel_name5>([]() [[cl::reqd_work_group_size(32, 32, 32)]] { | ||
f32x32x32(); | ||
kernel<class kernel_name5>([]() [[cl::reqd_work_group_size(32, 32, 32), cl::reqd_work_group_size(32, 32, 32)]] { | ||
f32x32x32(); | ||
}); | ||
|
||
|
||
#ifdef TRIGGER_ERROR | ||
Functor8 f8; | ||
kernel<class kernel_name6>(f8); | ||
|
||
Functor32 f32; | ||
kernel<class kernel_name1>(f32); | ||
|
||
kernel<class kernel_name7>([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}} | ||
f4x1x1(); | ||
f32x1x1(); | ||
|
@@ -102,17 +111,17 @@ void bar() { | |
}); | ||
|
||
// expected-error@+1 {{expected variable name or 'this' in lambda capture list}} | ||
kernel<class kernel_name10>([[cl::reqd_work_group_size(32, 32, 32)]] []() { | ||
kernel<class kernel_name10>([[cl::reqd_work_group_size(32, 32, 32)]][]() { | ||
f32x32x32(); | ||
}); | ||
|
||
#endif | ||
} | ||
|
||
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name1 | ||
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 16 1 1 | ||
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 1 1 16 | ||
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name2 | ||
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 4 1 1 | ||
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 1 1 4 | ||
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name3 | ||
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 16 16 16 | ||
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name4 | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not reversed. Does the warning below still work correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can work. Is there test for it?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If yes, then it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I was going to ask.
If I'm reading this code correctly, we compare XDim of an existing attribute with WGSize[0], which is going to be ZDim. Shouldn't we compare existing XDim with WGSize[2] instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you are right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to prove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it need to be reversed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that the diagnostic was not tested. Can you add a test for it?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general case was tested, see: reqd-work-group-size.cpp:23 - 31, and these diagnostics are firing anyway.
But with this patch there is a corner case introduced, that was untested, like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add one test, that prove rightness of the implementation.