Skip to content

Commit 4dd874b

Browse files
authored
[NFC][SYCL] Improve kernel metadata test (#1610)
There was a bug in kernel_arg_addr_space metadata generation (SYCL addr spaces were ignored), that was fixed in ac94b1e. Expand the test accordingly. Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent c8d86a8 commit 4dd874b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -I %S/Inputs -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
22

3-
// CHECK: define {{.*}}spir_kernel void @_ZTSZ4mainE15kernel_function() {{[^{]+}} !kernel_arg_addr_space ![[MD:[0-9]+]] !kernel_arg_access_qual ![[MD]] !kernel_arg_type ![[MD]] !kernel_arg_base_type ![[MD]] !kernel_arg_type_qual ![[MD]]
4-
// CHECK: ![[MD]] = !{}
3+
// CHECK: define {{.*}}spir_kernel void @_ZTSZ4mainE15kernel_function{{.*}} !kernel_arg_addr_space ![[MDAS:[0-9]+]] !kernel_arg_access_qual ![[MDAC:[0-9]+]] !kernel_arg_type ![[MDAT:[0-9]+]] !kernel_arg_base_type ![[MDAT:[0-9]+]] !kernel_arg_type_qual ![[MDATQ:[0-9]+]]
4+
// CHECK: ![[MDAS]] = !{i32 1, i32 0, i32 0, i32 0}
5+
// CHECK: ![[MDAC]] = !{!"none", !"none", !"none", !"none"}
6+
// CHECK: ![[MDAT]] = !{!"int*", !"cl::sycl::range<1>", !"cl::sycl::range<1>", !"cl::sycl::id<1>"}
7+
// CHECK: ![[MDATQ]] = !{!"", !"", !"", !""}
58

6-
template <typename name, typename Func>
7-
__attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) {
8-
kernelFunc();
9-
}
9+
#include "sycl.hpp"
1010

1111
int main() {
12-
kernel_single_task<class kernel_function>([]() {});
12+
cl::sycl::accessor<int, 1, cl::sycl::access::mode::read_write> accessorA;
13+
cl::sycl::kernel_single_task<class kernel_function>(
14+
[=]() {
15+
accessorA.use();
16+
});
1317
return 0;
1418
}

0 commit comments

Comments
 (0)