summaryrefslogtreecommitdiff
path: root/kernels/compiler_subgroup_image_block_read.cl
blob: 596265f5ea363c8d17098a44682d0ea5699eb145 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
__kernel void compiler_subgroup_image_block_read_ui1(image2d_t src, global uint *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
  uint tmp = intel_sub_group_block_read_ui(src,coord);
  dst[id] = tmp;
}

__kernel void compiler_subgroup_image_block_read_ui2(image2d_t src, global uint2 *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
  uint2 tmp = intel_sub_group_block_read_ui2(src,coord);
  dst[id] = tmp;
}

__kernel void compiler_subgroup_image_block_read_ui4(image2d_t src, global uint4 *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
  uint4 tmp = intel_sub_group_block_read_ui4(src,coord);
  dst[id] = tmp;
}

__kernel void compiler_subgroup_image_block_read_ui8(image2d_t src, global uint8 *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
  uint8 tmp = intel_sub_group_block_read_ui8(src,coord);
  dst[id] = tmp;
}
#ifdef SHORT
__kernel void compiler_subgroup_image_block_read_us1(image2d_t src, global ushort *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
  ushort tmp = intel_sub_group_block_read_us(src,coord);
  dst[id] = tmp;
}

__kernel void compiler_subgroup_image_block_read_us2(image2d_t src, global ushort2 *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
  ushort2 tmp = intel_sub_group_block_read_us2(src,coord);
  dst[id] = tmp;
}

__kernel void compiler_subgroup_image_block_read_us4(image2d_t src, global ushort4 *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
  ushort4 tmp = intel_sub_group_block_read_us4(src,coord);
  dst[id] = tmp;
}

__kernel void compiler_subgroup_image_block_read_us8(image2d_t src, global ushort8 *dst)
{
  int id = get_global_id(0);
  int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
  ushort8 tmp = intel_sub_group_block_read_us8(src,coord);
  dst[id] = tmp;
}
#endif
#ifdef MEDIA_BLOCK_IO
__kernel void compiler_subgroup_media_block_read_ui1(image2d_t src, global uint *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(uint) + sizeof(uint) * get_group_id(0) * get_local_size(0),yid);
  uint tmp = intel_sub_group_media_block_read_ui(coord, 16, 1, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_ui2(image2d_t src, global uint2 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(uint) + sizeof(uint) * get_group_id(0) * get_local_size(0),yid*2);
  uint2 tmp = intel_sub_group_media_block_read_ui2(coord, 16, 2, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_ui4(image2d_t src, global uint4 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(uint) + sizeof(uint) * get_group_id(0) * get_local_size(0),yid*4);
  uint4 tmp = intel_sub_group_media_block_read_ui4(coord, 16, 4, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_ui8(image2d_t src, global uint8 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(uint) + sizeof(uint) * get_group_id(0) * get_local_size(0),yid*8);
  uint8 tmp = intel_sub_group_media_block_read_ui8(coord, 16, 8, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_us1(image2d_t src, global ushort *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(ushort) + sizeof(ushort) * get_group_id(0) * get_local_size(0),yid);
  ushort tmp = intel_sub_group_media_block_read_us(coord, 16, 1, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_us2(image2d_t src, global ushort2 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(ushort) + sizeof(ushort) * get_group_id(0) * get_local_size(0),yid*2);
  ushort2 tmp = intel_sub_group_media_block_read_us2(coord, 16, 2, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_us4(image2d_t src, global ushort4 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(ushort) + sizeof(ushort) * get_group_id(0) * get_local_size(0),yid*4);
  ushort4 tmp = intel_sub_group_media_block_read_us4(coord, 16, 4, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_us8(image2d_t src, global ushort8 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(ushort) + sizeof(ushort) * get_group_id(0) * get_local_size(0),yid*8);
  ushort8 tmp = intel_sub_group_media_block_read_us8(coord, 16, 8, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void  __attribute__((intel_reqd_sub_group_size(8)))
compiler_subgroup_media_block_read_us16(image2d_t src, global ushort16 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(ushort) + sizeof(ushort) * get_group_id(0) * get_local_size(0),yid*16);
  ushort16 tmp = intel_sub_group_media_block_read_us16(coord, 8, 16, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_uc1(image2d_t src, global uchar *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(char) + sizeof(char) * get_group_id(0) * get_local_size(0),yid);
  uchar tmp = intel_sub_group_media_block_read_uc(coord, 16, 1, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_uc2(image2d_t src, global uchar2 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(char) + sizeof(char) * get_group_id(0) * get_local_size(0),yid*2);
  uchar2 tmp = intel_sub_group_media_block_read_uc2(coord, 16, 2, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_uc4(image2d_t src, global uchar4 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(char) + sizeof(char) * get_group_id(0) * get_local_size(0),yid*4);
  uchar4 tmp = intel_sub_group_media_block_read_uc4(coord, 16, 4, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_uc8(image2d_t src, global uchar8 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(char) + sizeof(char) * get_group_id(0) * get_local_size(0),yid*8);
  uchar8 tmp = intel_sub_group_media_block_read_uc8(coord, 16, 8, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
__kernel void compiler_subgroup_media_block_read_uc16(image2d_t src, global uchar16 *dst)
{
  int id = get_global_id(0);
  int yid = get_global_id(1);
  int2 coord = (int2)(get_sub_group_size()*get_sub_group_id()*sizeof(char) + sizeof(char) * get_group_id(0) * get_local_size(0),yid*16);
  uchar16 tmp = intel_sub_group_media_block_read_uc16(coord, 16, 16, src);
  dst[yid * get_global_size(0) + id] = tmp;
}
#endif