-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Propagate attributes from transitive calls to kernel #1878
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
11 commits
Select commit
Hold shift + click to select a range
fd4591c
[SYCL] Fixing comment about propagation of attributes to kernel
schittir 6b5d4a9
[SYCL] Fixing comment about propagation of attributes to kernel
schittir 3857f54
[SYCL] Fixing comment about propagation of attributes to kernel
schittir ef2deea
Propagate attributes from transitive calls to kernel
schittir 3426ef0
Correct failing lit tests
schittir acb7a65
Minor changes to address comments and resolve branch merge conflicts
schittir eb3a32e
Fix formatting issues reported by clang-format-check bot
schittir 49c747c
Add diagnostics for conflicting attributes from transitive calls
schittir e3e79b1
Fix formatting
schittir 882b3d0
Fix lit test failure caused by newer commits to repo
schittir 1735df4
Fix the bug causing lit test failure
schittir 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
54 changes: 54 additions & 0 deletions
54
clang/test/SemaSYCL/check-notdirect-attribute-propagation.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,54 @@ | ||
// RUN: %clang_cc1 %s -fsyntax-only -fsycl -fsycl-is-device -triple spir64 -verify | ||
// RUN: %clang_cc1 %s -fsyntax-only -fsycl -fsycl-is-device -triple spir64 -DTRIGGER_ERROR -verify | ||
// RUN: %clang_cc1 %s -fsyntax-only -ast-dump -fsycl -fsycl-is-device -triple spir64 | FileCheck %s | ||
|
||
#ifndef TRIGGER_ERROR | ||
[[intelfpga::no_global_work_offset]] void not_direct_one() {} // expected-no-diagnostics | ||
|
||
[[intel::reqd_sub_group_size(1)]] void func_one() { | ||
not_direct_one(); | ||
} | ||
|
||
#else | ||
[[cl::reqd_work_group_size(2, 2, 2)]] void not_direct_two() {} // expected-note {{conflicting attribute is here}} | ||
|
||
[[intelfpga::max_work_group_size(1, 1, 1)]] // expected-note {{conflicting attribute is here}} | ||
void | ||
func_two() { | ||
not_direct_two(); | ||
} | ||
|
||
[[cl::reqd_work_group_size(4, 4, 4)]] // expected-note 2 {{conflicting attribute is here}} | ||
void | ||
func_three() { | ||
not_direct_two(); | ||
} | ||
#endif | ||
|
||
template <typename Name, typename Type> | ||
[[clang::sycl_kernel]] void __my_kernel__(Type bar) { | ||
bar(); | ||
#ifndef TRIGGER_ERROR | ||
func_one(); | ||
#else | ||
func_two(); | ||
func_three(); | ||
#endif | ||
} | ||
|
||
template <typename Name, typename Type> | ||
void parallel_for(Type lambda) { | ||
__my_kernel__<Name>(lambda); | ||
} | ||
|
||
void invoke_foo2() { | ||
#ifndef TRIGGER_ERROR | ||
// CHECK-LABEL: FunctionDecl {{.*}} invoke_foo2 'void ()' | ||
// CHECK: `-FunctionDecl {{.*}}KernelName 'void ()' | ||
// CHECK: -IntelReqdSubGroupSizeAttr {{.*}} | ||
// CHECK: `-SYCLIntelNoGlobalWorkOffsetAttr {{.*}} Enabled | ||
parallel_for<class KernelName>([]() {}); | ||
#else | ||
parallel_for<class KernelName>([]() {}); // expected-error 2 {{conflicting attributes applied to a SYCL kernel or SYCL_EXTERNAL function}} | ||
#endif | ||
} |
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
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.