forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel-param-acc-array-ih.cpp
More file actions
51 lines (36 loc) · 1.42 KB
/
kernel-param-acc-array-ih.cpp
File metadata and controls
51 lines (36 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -fsycl-int-header=%t.h %s -fsyntax-only
// RUN: FileCheck -input-file=%t.h %s
// This test checks the integration header generated when
// the kernel argument is an Accessor array.
// CHECK: #include <sycl/detail/kernel_desc.hpp>
// CHECK: class kernel_A;
// CHECK: namespace sycl {
// CHECK-NEXT: inline namespace _V1 {
// CHECK-NEXT: namespace detail {
// CHECK: static constexpr
// CHECK-NEXT: const char* const kernel_names[] = {
// CHECK-NEXT: "_ZTSZ4mainE8kernel_A",
// CHECK-NEXT: ""
// CHECK-NEXT: };
// CHECK: static constexpr int kernel_args_sizes[] = {2, -1,
// CHECK: static constexpr
// CHECK-NEXT: const kernel_param_desc_t kernel_signatures[] = {
// CHECK-NEXT: //--- _ZTSZ4mainE8kernel_A
// CHECK-NEXT: { kernel_param_kind_t::kind_accessor, 4062, 0 },
// CHECK-NEXT: { kernel_param_kind_t::kind_accessor, 4062, 12 },
// CHECK-EMPTY:
// CHECK-NEXT: { kernel_param_kind_t::kind_invalid, -987654321, -987654321 },
// CHECK-NEXT: };
// CHECK: template <> struct KernelInfo<kernel_A> {
#include "Inputs/sycl.hpp"
using namespace sycl;
template <typename name, typename Func>
__attribute__((sycl_kernel)) void a_kernel(const Func &kernelFunc) {
kernelFunc();
}
int main() {
using Accessor =
accessor<int, 1, access::mode::read_write, access::target::global_buffer>;
Accessor acc[2];
a_kernel<class kernel_A>([=]() { acc[1].use(); });
}