-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL] Cleanup/refactor device_code_tests #14063
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
Changes from 6 commits
9f94263
5fb2b92
78d0169
983fb4b
f47da5c
3521682
a081f88
01c7b1a
65e81c7
a47bc04
736eb1b
05b29ef
95edc70
b1dc13a
874846e
eeac017
91f78bd
c1687a5
3396907
b0572cb
125c771
034236c
7c6c0dd
2f8a39d
54355e0
d9f6097
fd43f02
fee74b1
5f3866a
e6418d9
0d3ecc4
f7653cb
2e51c65
f732ef3
089dafc
48c4c0b
dfbf258
7a940f2
a26c7fb
e8f0bb3
f642cd3
c726fd1
fbcb8bd
e9ba164
001d8fb
649453d
caaa88c
77c2a78
04e4ee3
a56c680
a5e6d68
5f41693
52111a7
9f76cfb
c1853cb
10958fa
43a0eb2
8632f90
829ff92
42f2e49
640e8db
d5fcbe9
9af1fb0
64914a2
e6872f1
5407ac6
e15729e
63f811c
3df8223
df02093
1e07f59
88560c4
8c284b6
8cfa566
ba5e9ca
88851d5
de58e29
6f4d939
fb22562
df6eaad
b54aefe
03b2e21
75bfeac
8e445ed
1e0efd8
f226ce3
284f419
5d94708
ca32941
69186a8
c394f03
f8f109a
f625bde
82ea253
a48a126
fd07268
80eb9f5
292fdda
bf585a0
5a68a78
c3eadc9
11df203
d7622c1
1ce91da
e533d5d
e194ce1
242fe06
abfd64a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,9 @@ | |
#include <sycl/sycl.hpp> | ||
|
||
using namespace sycl; | ||
queue q; | ||
|
||
// CHECK-ASPECTS: define weak_odr dso_local spir_kernel void @{{.*}}kernel_name_1{{.*}} !sycl_declared_aspects ![[ASPECTS1:[0-9]+]] {{.*}} | ||
// CHECK-SRCLOC: define weak_odr dso_local spir_kernel void @{{.*}}kernel_name_1{{.*}} !srcloc ![[SRCLOC1:[0-9]+]] {{.*}} | ||
// CHECK-ASPECTS: define dso_local spir_func void @{{.*}}kernel_name_1{{.*}} !sycl_declared_aspects ![[ASPECTS1:[0-9]+]] {{.*}} | ||
// CHECK-SRCLOC: define dso_local spir_func void @{{.*}}kernel_name_1{{.*}} !srcloc ![[SRCLOC1:[0-9]+]] {{.*}} | ||
|
||
// CHECK-ASPECTS: define {{.*}}spir_func void @{{.*}}func1{{.*}} !sycl_declared_aspects ![[ASPECTS1]] | ||
// CHECK-ASPECTS-SAME: !sycl_used_aspects ![[ASPECTS1]] | ||
|
@@ -45,29 +44,19 @@ constexpr sycl::aspect getAspect() { return sycl::aspect::cpu; } | |
// CHECK-SRCLOC: define {{.*}}spir_func void @{{.*}}func6{{.*}} !srcloc ![[SRCLOC7:[0-9]+]] | ||
[[sycl::device_has(getAspect())]] void func6() {} | ||
|
||
class KernelFunctor { | ||
public: | ||
[[sycl::device_has(sycl::aspect::cpu)]] void operator()() const { | ||
func1(); | ||
func2(); | ||
func3(); | ||
func4<sycl::aspect::host>(); | ||
func5(); | ||
func6(); | ||
} | ||
}; | ||
|
||
void foo() { | ||
q.submit([&](handler &h) { | ||
KernelFunctor f1; | ||
h.single_task<class kernel_name_1>(f1); | ||
// CHECK-ASPECTS: define weak_odr dso_local spir_kernel void @{{.*}}kernel_name_2{{.*}} !sycl_declared_aspects ![[ASPECTS4:[0-9]+]] | ||
// CHECK-SRCLOC: define weak_odr dso_local spir_kernel void @{{.*}}kernel_name_2{{.*}} !srcloc ![[SRCLOC8:[0-9]+]] {{.*}} | ||
h.single_task<class kernel_name_2>( | ||
[]() [[sycl::device_has(sycl::aspect::gpu)]] {}); | ||
}); | ||
SYCL_EXTERNAL [[sycl::device_has(sycl::aspect::cpu)]] void kernel_name_1() { | ||
func1(); | ||
func2(); | ||
func3(); | ||
func4<sycl::aspect::host>(); | ||
func5(); | ||
func6(); | ||
} | ||
|
||
// CHECK-ASPECTS: define dso_local spir_func void @{{.*}}kernel_name_2{{.*}} !sycl_declared_aspects ![[ASPECTS4:[0-9]+]] | ||
// CHECK-SRCLOC: define dso_local spir_func void @{{.*}}kernel_name_2{{.*}} !srcloc ![[SRCLOC8:[0-9]+]] {{.*}} | ||
SYCL_EXTERNAL [[sycl::device_has(sycl::aspect::gpu)]] void kernel_name_2() {} | ||
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. I think we might need both new and old code, actually. Someone from @intel/dpcpp-tools-reviewers should review changes in this file. 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. The attribute can be applied to both kernels and 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. I split the test cases into 2 files, one for kernels and one for functions. Am I good to proceed with this? |
||
|
||
// CHECK-ASPECTS-DAG: [[ASPECTS1]] = !{![[ASPECTCPU:[0-9]+]]} | ||
// CHECK-ASPECTS-DAG: [[ASPECTCPU]] = !{!"cpu", i32 1} | ||
// CHECK-SRCLOC-DAG: [[SRCLOC1]] = !{i32 {{[0-9]+}}} | ||
|
Uh oh!
There was an error while loading. Please reload this page.