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
|
__kernel void compiler_subgroup_image_block_write_ui1(image2d_t dst, global uint *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
intel_sub_group_block_write_ui(dst,coord, src[id]);
}
__kernel void compiler_subgroup_image_block_write_ui2(image2d_t dst, global uint2 *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
intel_sub_group_block_write_ui2(dst,coord, src[id]);
}
__kernel void compiler_subgroup_image_block_write_ui4(image2d_t dst, global uint4 *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
intel_sub_group_block_write_ui4(dst,coord, src[id]);
}
__kernel void compiler_subgroup_image_block_write_ui8(image2d_t dst, global uint8 *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(uint),0);
intel_sub_group_block_write_ui8(dst,coord, src[id]);
}
#ifdef SHORT
__kernel void compiler_subgroup_image_block_write_us1(image2d_t dst, global ushort *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
intel_sub_group_block_write_us(dst,coord, src[id]);
}
__kernel void compiler_subgroup_image_block_write_us2(image2d_t dst, global ushort2 *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
intel_sub_group_block_write_us2(dst,coord, src[id]);
}
__kernel void compiler_subgroup_image_block_write_us4(image2d_t dst, global ushort4 *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
intel_sub_group_block_write_us4(dst,coord, src[id]);
}
__kernel void compiler_subgroup_image_block_write_us8(image2d_t dst, global ushort8 *src)
{
int id = get_global_id(0);
int2 coord = (int2)(get_simd_size()*get_sub_group_id()*sizeof(ushort),0);
intel_sub_group_block_write_us8(dst,coord, src[id]);
}
#endif
#ifdef MEDIA_BLOCK_IO
__kernel void compiler_subgroup_media_block_write_ui1(image2d_t dst, global uint *src)
{
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);
intel_sub_group_media_block_write_ui(coord, 16, 1, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_ui2(image2d_t dst, global uint2 *src)
{
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);
intel_sub_group_media_block_write_ui2(coord, 16, 2, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_ui4(image2d_t dst, global uint4 *src)
{
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);
intel_sub_group_media_block_write_ui4(coord, 16, 4, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_ui8(image2d_t dst, global uint8 *src)
{
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);
intel_sub_group_media_block_write_ui8(coord, 16, 8, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_us1(image2d_t dst, global ushort *src)
{
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);
intel_sub_group_media_block_write_us(coord, 16, 1, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_us2(image2d_t dst, global ushort2 *src)
{
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);
intel_sub_group_media_block_write_us2(coord, 16, 2, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_us4(image2d_t dst, global ushort4 *src)
{
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);
intel_sub_group_media_block_write_us4(coord, 16, 4, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_us8(image2d_t dst, global ushort8 *src)
{
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);
intel_sub_group_media_block_write_us8(coord, 16, 8, src[id], dst);
}
__kernel void __attribute__((intel_reqd_sub_group_size(8)))
compiler_subgroup_media_block_write_us16(image2d_t dst, global ushort16 *src)
{
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);
intel_sub_group_media_block_write_us16(coord, 8, 16, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_uc1(image2d_t dst, global uchar *src)
{
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);
intel_sub_group_media_block_write_uc(coord, 16, 1, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_uc2(image2d_t dst, global uchar2 *src)
{
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);
intel_sub_group_media_block_write_uc2(coord, 16, 2, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_uc4(image2d_t dst, global uchar4 *src)
{
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);
intel_sub_group_media_block_write_uc4(coord, 16, 4, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_uc8(image2d_t dst, global uchar8 *src)
{
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);
intel_sub_group_media_block_write_uc8(coord, 16, 8, src[id], dst);
}
__kernel void compiler_subgroup_media_block_write_uc16(image2d_t dst, global uchar16 *src)
{
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);
intel_sub_group_media_block_write_uc16(coord, 16, 16, src[id], dst);
}
#endif
|