ae2f_docs
Loading...
Searching...
No Matches
source.cl
1/**
2 * This source is test experimental.
3 * extensions will be attributes inside.
4 *
5 * macros will be defined in opencl-base.h
6 **/
7
8struct STRUCTURE {
9 int aa;
10 struct {
11 float D;
12 double C;
13 } M;
14 int a;
15 int b;
16};
17
18enum {
19 LOCU32_COUNT = 15
20};
21
22__constant const int LOCU32_COUNT_0 = 3;
23
24#if 1
25void not_kernel(void) {}
26#endif
27
28__attribute__((annotate("reqd_work_group_size(2, 2, 2)"))) /** work group size should be specified on constant time. */
29__kernel void KERNEL_0(
30 uint pushu32,
31
32 /** this is descriptor set specifier */
33 __global uint* __attribute__((annotate("aclspv_set(2)"))) globu32,
34 /**
35 * spec constant id could & must be specified on use.
36 * this is one of its declaration: array size specified constant.
37 */
38 __local double __attribute__((annotate("aclspv_specid(0)")))
39 locu32_0[LOCU32_COUNT], /** local(workgroup) must be array */
40 __global float* globf32,
41 float pushf32,
42
43 /** Push constant could use fixed array, and compound struct, but they cannot use spec constant-fixed array for it. */
44 struct STRUCTURE push_struct
45 )
46{
47#if 0
48 globu32[get_global_id(0)] += pushu32 + sin(globf32[get_global_id(0)]);
49 (void)(1 + get_global_id(0));
50 return;
51#endif
52}
53
54
55__attribute__((annotate("aclspv_execmodel(0)")))
56__kernel void N_KERNEL_0(__constant uintptr_t* consti32, __attribute__((annotate("aclspv_storage_class(3)"))) __global const uint* u32out) {
57 const size_t specid_0 __attribute__((annotate("aclspv_specid(0)"))) = 0;
58 const size_t specid_1 __attribute__((annotate("aclspv_specid(1)"))) = 1;
59 int a;
60 float b;
61
62
63 3;
64 a;
65 3 + 4 + 3;
66
67 a + 3;
68 a + 4.0 + 3;
69
70 b;
71 b + 3;
72
73 goto AGOTO;
74AGOTO:
75 return;
76}
77
78kernel void do_none(void)
79{
80 size_t g = get_global_id(0);
81 struct { char a; int b; } C;
82}
83
84#if 0
85kernel void do_add_sub(__global short4 *add_out, __global short4 *sub_out,
86 __global short4 *x, __global short4 *y)
87{
88 size_t g = get_global_id(0);
89 add_out[g] = x[g] + y[g];
90 sub_out[g] = x[g] - y[g];
91}
92#endif