1
- // RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) '
2
- // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE='
1
+ // RUN: %clang_cc1 -triple spir64-unknown-unknown -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) '
2
+ // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsycl-is-host -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE='
3
3
4
4
5
5
template <typename KN, typename Func>
6
- __attribute__ ((sycl_kernel)) void kernel(Func F){
6
+ [[clang::sycl_kernel_entry_point(KN)]] void kernel (Func F){
7
7
F ();
8
8
}
9
9
10
10
template <typename KN, typename Func>
11
- __attribute__ ((sycl_kernel)) void kernel2(Func F){
11
+ [[clang::sycl_kernel_entry_point(KN)]] void kernel2 (Func F){
12
12
F (1 );
13
13
}
14
14
15
15
template <typename KN, typename Func>
16
- __attribute__ ((sycl_kernel)) void kernel3(Func F){
16
+ [[clang::sycl_kernel_entry_point(KN)]] void kernel3 (Func F){
17
17
F (1.1 );
18
18
}
19
19
@@ -31,10 +31,19 @@ int main() {
31
31
32
32
// Ensure the kernels are named the same between the device and host
33
33
// invocations.
34
+ // Call from host.
34
35
(void )__builtin_sycl_unique_stable_name (decltype (lambda1));
35
36
(void )__builtin_sycl_unique_stable_name (decltype (lambda2));
36
37
(void )__builtin_sycl_unique_stable_name (decltype (lambda3));
37
38
39
+ // Call from device.
40
+ auto lambda4 = [](){
41
+ (void )__builtin_sycl_unique_stable_name (decltype (lambda1));
42
+ (void )__builtin_sycl_unique_stable_name (decltype (lambda2));
43
+ (void )__builtin_sycl_unique_stable_name (decltype (lambda3));
44
+ };
45
+ kernel<class K4 >(lambda4);
46
+
38
47
// Make sure the following 3 are the same between the host and device compile.
39
48
// Note that these are NOT the same value as each other, they differ by the
40
49
// signature.
0 commit comments