Skip to content

[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 11 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correct failing lit tests
  • Loading branch information
schittir committed Jul 27, 2020
commit 3426ef0fc17cfb7d604da655fe41ef1f4fe11c2b
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fsycl -fsycl-is-device -verify %s
// RUN: %clang %s -fsyntax-only -Xclang -ast-dump -fsycl-device-only | FileCheck %s

[[intelfpga::no_global_work_offset]] void not_direct() {} // expected-no-warning
[[intelfpga::no_global_work_offset]] void not_direct() {}

void func() { not_direct(); }

Expand All @@ -16,5 +16,8 @@ void parallel_for(Type lambda) {
}

void invoke_foo2() {
// CHECK-LABEL: FunctionDecl {{.*}} invoke_foo2 'void ()'
// CHECK: `-FunctionDecl {{.*}} _ZTSZ11invoke_foo2vE10KernelName 'void ()'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest {{.}}KernelName{{.}} Differences in name mangling on Windows will cause issues otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this thought, and changed it per your suggestion. However, please note that there are other lit tests following this name mangled pattern, with which I intended to be consistent.

// CHECK: -SYCLIntelNoGlobalWorkOffsetAttr {{.*}} Enabled
parallel_for<class KernelName>([]() {});
}
2 changes: 1 addition & 1 deletion clang/test/SemaSYCL/intel-max-global-work-dim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void foo() {

#else // __SYCL_DEVICE_ONLY__

[[intelfpga::max_global_work_dim(2)]] // expected-warning{{'max_global_work_dim' attribute ignored}}
[[intelfpga::max_global_work_dim(2)]]
void func_ignore() {}

struct FuncObj {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaSYCL/intel-max-work-group-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void foo() {

#else // __SYCL_DEVICE_ONLY__

[[intelfpga::max_work_group_size(2, 2, 2)]] // expected-warning{{'max_work_group_size' attribute ignored}}
[[intelfpga::max_work_group_size(2, 2, 2)]]
void func_ignore() {}

struct FuncObj {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaSYCL/intel-restrict.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 %s -fsyntax-only -fsycl -fsycl-is-device -triple spir64 -DCHECKDIAG -verify
// RUN: %clang_cc1 %s -fsyntax-only -ast-dump -fsycl -fsycl-is-device -triple spir64 | FileCheck %s

[[intel::kernel_args_restrict]] // expected-warning{{'kernel_args_restrict' attribute ignored}}
[[intel::kernel_args_restrict]]
void func_ignore() {}

struct FuncObj {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaSYCL/num_simd_work_items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void foo() {

#else // __SYCL_DEVICE_ONLY__

[[intelfpga::num_simd_work_items(2)]] // expected-warning{{'num_simd_work_items' attribute ignored}}
[[intelfpga::num_simd_work_items(2)]]
void func_ignore() {}

struct FuncObj {
Expand Down