forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel-param-pod-array-ih.cpp
More file actions
71 lines (56 loc) · 1.9 KB
/
kernel-param-pod-array-ih.cpp
File metadata and controls
71 lines (56 loc) · 1.9 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// 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 for a kernel
// with an argument that is a POD array.
// CHECK: #include <sycl/detail/kernel_desc.hpp>
// CHECK: class kernel_B;
// 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_B",
// CHECK-NEXT: "_ZTSZ4mainE8kernel_C",
// CHECK-NEXT: "_ZTSZ4mainE8kernel_D",
// CHECK-NEXT: ""
// CHECK-NEXT: };
// CHECK: static constexpr int kernel_args_sizes[] = {1, 1, 1, -1,
// CHECK: static constexpr
// CHECK-NEXT: const kernel_param_desc_t kernel_signatures[] = {
// CHECK-NEXT: //--- _ZTSZ4mainE8kernel_B
// CHECK-NEXT: { kernel_param_kind_t::kind_std_layout, 20, 0 },
// CHECK-EMPTY:
// CHECK-NEXT: //--- _ZTSZ4mainE8kernel_C
// CHECK-NEXT: { kernel_param_kind_t::kind_std_layout, 24, 0 },
// CHECK-EMPTY:
// CHECK-NEXT: //--- _ZTSZ4mainE8kernel_D
// CHECK-NEXT: { kernel_param_kind_t::kind_std_layout, 48, 0 },
// CHECK-EMPTY:
// CHECK-NEXT: { kernel_param_kind_t::kind_invalid, -987654321, -987654321 },
// CHECK-NEXT: };
// CHECK: template <> struct KernelInfo<kernel_B> {
// CHECK: template <> struct KernelInfo<kernel_C> {
// CHECK: template <> struct KernelInfo<kernel_D> {
#include "Inputs/sycl.hpp"
using namespace sycl;
template <typename name, typename Func>
__attribute__((sycl_kernel)) void a_kernel(const Func &kernelFunc) {
kernelFunc();
}
int main() {
int a[5];
int b[2][3];
int c[2][3][2];
a_kernel<class kernel_B>(
[=]() {
int local = a[3];
});
a_kernel<class kernel_C>(
[=]() {
int local = b[0][1];
});
a_kernel<class kernel_D>(
[=]() {
int local = c[0][1][1];
});
}