blob: 55a598354a89e5ee18a9786336694eabb280c222 [file] [log] [blame]
Joel Liangf1f3ebd2017-11-10 09:59:19 +08001/*
2 * Copyright (c) 2017 ARM Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef ARM_COMPUTE_HELPER_CS_H
26#define ARM_COMPUTE_HELPER_CS_H
27
28#define SHADER_PARAMS_DECLARATION \
29 layout(std140, binding = 0) uniform shader_params
30
31#define TENSOR_DECLARATION(location, buffer_type, type, ptr_name, shift_name, element_shift, access) \
32 layout(std430, binding = location) access buffer buffer_type \
33 { \
34 type ptr_name[]; \
35 }; \
36 const uint shift_name = uint(element_shift)
37
38struct VectorAttributes
39{
40 uint stride_x; /**< Stride of the vector in X dimension (in bytes) */
41 uint step_x; /**< stride_x * number of elements along X processed per workitem (in bytes) */
42 uint offset_first_element_in_bytes; /**< The offset of the first element in the vector (in bytes) */
43 uint padding; /**< The padding to rounding up the structure to a multiple of a vec4 */
44};
45
46struct ImageAttributes
47{
48 uint stride_x; /**< Stride of the image in X dimension (in bytes) */
49 uint step_x; /**< stride_x * number of elements along X processed per workitem (in bytes) */
50 uint stride_y; /**< Stride of the image in Y dimension (in bytes) */
51 uint step_y; /**< stride_y * number of elements along Y processed per workitem (in bytes) */
52 uint offset_first_element_in_bytes; /**< The offset of the first element in the image (in bytes) */
53 uint padding1; /**< The padding to rounding up the structure to a multiple of a vec4 */
54 uint padding2; /**< The padding to rounding up the structure to a multiple of a vec4 */
55 uint padding3; /**< The padding to rounding up the structure to a multiple of a vec4 */
56};
57
58struct Tensor3DAttributes
59{
60 uint stride_x; /**< Stride of the tensor in X dimension (in bytes) */
61 uint step_x; /**< stride_x * number of elements along X processed per workitem (in bytes) */
62 uint stride_y; /**< Stride of the tensor in Y dimension (in bytes) */
63 uint step_y; /**< stride_y * number of elements along Y processed per workitem (in bytes) */
64 uint stride_z; /**< Stride of the tensor in Z dimension (in bytes) */
65 uint step_z; /**< stride_z * number of elements along Z processed per workitem (in bytes) */
66 uint offset_first_element_in_bytes; /**< The offset of the first element in the tensor (in bytes) */
67 uint padding; /**< The padding to rounding up the structure to a multiple of a vec4 */
68};
69
70struct VectorIterator
71{
72 int current_offset_in_bytes; /**< Current offset of vector (in bytes) */
73 int stride_x; /**< Stride of the vector in X dimension (in bytes) */
74 int element_shift; /**< The number of bits to shift by for one element */
75};
76
77struct ImageIterator
78{
79 int current_offset_in_bytes; /**< Current offset of image (in bytes) */
80 int stride_x; /**< Stride of the image in X dimension (in bytes) */
81 int stride_y; /**< Stride of the image in Y dimension (in bytes) */
82 int element_shift; /**< The number of bits to shift by for one element */
83};
84
85struct Tensor3DIterator
86{
87 int current_offset_in_bytes; /**< Current offset of tensor (in bytes) */
88 int stride_x; /**< Stride of the tensor in X dimension (in bytes) */
89 int stride_y; /**< Stride of the tensor in Y dimension (in bytes) */
90 int stride_z; /**< Stride of the tensor in Z dimension (in bytes) */
91 int element_shift; /**< The number of bits to shift by for one element */
92};
93
94#define CONVERT_TO_VECTOR_ITERATOR(attrs, element_shift) \
95 update_vector_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
96 attrs.stride_x, attrs.step_x)
97
98#define CONVERT_TO_VECTOR_ITERATOR_NO_STEP(attrs, element_shift) \
99 update_vector_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
100 attrs.stride_x, uint(0))
101
102#define CONVERT_TO_IMAGE_ITERATOR(attrs, element_shift) \
103 update_image_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
104 attrs.stride_x, attrs.step_x, attrs.stride_y, attrs.step_y)
105
106#define CONVERT_TO_IMAGE_ITERATOR_NO_STEP(attrs, element_shift) \
107 update_image_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
108 attrs.stride_x, uint(0), attrs.stride_y, uint(0))
109
110#define CONVERT_TO_TENSOR3D_ITERATOR(attrs, element_shift) \
111 update_tensor3D_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
112 attrs.stride_x, attrs.step_x, attrs.stride_y, attrs.step_y, attrs.stride_z, attrs.step_z)
113
114#define CONVERT_TO_TENSOR3D_ITERATOR_NO_STEP(attrs, element_shift) \
115 update_tensor3D_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
116 attrs.stride_x, uint(0), attrs.stride_y, uint(0), attrs.stride_z, uint(0))
117
118#define CONVERT_TENSOR3D_TO_IMAGE_ITERATOR(attrs, element_shift) \
119 update_image_from_tensor3D_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
120 attrs.stride_x, attrs.step_x, attrs.stride_y, attrs.step_y, attrs.stride_z, attrs.step_z)
121
122#define CONVERT_TENSOR3D_TO_IMAGE_ITERATOR_NO_STEP(attrs, element_shift) \
123 update_image_from_tensor3D_iter_offset(element_shift, attrs.offset_first_element_in_bytes, \
124 attrs.stride_x, uint(0), attrs.stride_y, uint(0), attrs.stride_z, attrs.step_z)
125
126/** Wrap vector information into a VectorIterator structure, and make the offset to be this workitem's position.
127 *
128 * @param[in] element_shift The number of bits to shift by for one element
129 * @param[in] offset_first_element_in_bytes The offset of the first element in the source vector
130 * @param[in] stride_x Stride of the vector in X dimension (in bytes)
131 * @param[in] step_x stride_x * number of elements along X processed per workitem (in bytes)
132 *
133 * @return A VectorIterator object
134 */
135VectorIterator update_vector_iter_offset(uint element_shift, uint offset_first_element_in_bytes, uint stride_x, uint step_x)
136{
137 VectorIterator vector_iter;
138 vector_iter.element_shift = int(element_shift);
139 vector_iter.stride_x = int(stride_x);
140 vector_iter.current_offset_in_bytes = int(offset_first_element_in_bytes + gl_GlobalInvocationID.x * step_x);
141
142 return vector_iter;
143}
144
145/** Wrap image information into an ImageIterator structure, and make the offset to be this workitem's position.
146 *
147 * @param[in] element_shift The number of bits to shift by for one element
148 * @param[in] offset_first_element_in_bytes The offset of the first element in the source image
149 * @param[in] stride_x Stride of the image in X dimension (in bytes)
150 * @param[in] step_x stride_x * number of elements along X processed per workitem (in bytes)
151 * @param[in] stride_y Stride of the image in Y dimension (in bytes)
152 * @param[in] step_y stride_y * number of elements along Y processed per workitem (in bytes)
153 *
154 * @return An ImageIterator object
155 */
156ImageIterator update_image_iter_offset(uint element_shift, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y)
157{
158 ImageIterator image_iter;
159 image_iter.element_shift = int(element_shift);
160 image_iter.stride_x = int(stride_x);
161 image_iter.stride_y = int(stride_y);
162 image_iter.current_offset_in_bytes = int(offset_first_element_in_bytes + gl_GlobalInvocationID.x * step_x + gl_GlobalInvocationID.y * step_y);
163
164 return image_iter;
165}
166
167/** Wrap 3D tensor information into a Tensor3DIterator structure, and make the offset to be this workitem's position.
168 *
169 * @param[in] element_shift The number of bits to shift by for one element
170 * @param[in] offset_first_element_in_bytes The offset of the first element in the source tersor
171 * @param[in] stride_x Stride of the tersor in X dimension (in bytes)
172 * @param[in] step_x stride_x * number of elements along X processed per workitem (in bytes)
173 * @param[in] stride_y Stride of the tersor in Y dimension (in bytes)
174 * @param[in] step_y stride_y * number of elements along Y processed per workitem (in bytes)
175 * @param[in] stride_z Stride of the tersor in Z dimension (in bytes)
176 * @param[in] step_z stride_z * number of elements along Z processed per workitem (in bytes)
177 *
178 * @return A 3D Tensor3DIterator object
179 */
180Tensor3DIterator update_tensor3D_iter_offset(uint element_shift, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y, uint stride_z, uint step_z)
181{
182 Tensor3DIterator tensor_iter;
183 tensor_iter.element_shift = int(element_shift);
184 tensor_iter.stride_x = int(stride_x);
185 tensor_iter.stride_y = int(stride_y);
186 tensor_iter.stride_z = int(stride_z);
187 tensor_iter.current_offset_in_bytes = int(offset_first_element_in_bytes + gl_GlobalInvocationID.x * step_x + gl_GlobalInvocationID.y * step_y + gl_GlobalInvocationID.z * step_z);
188
189 return tensor_iter;
190}
191
192/** Wrap 3D tensor information into an ImageIterator structure, and make the offset to be this workitem's position.
193 *
194 * @param[in] element_shift The number of bits to shift by for one element
195 * @param[in] offset_first_element_in_bytes The offset of the first element in the source tensor
196 * @param[in] stride_x Stride of the tensor in X dimension (in bytes)
197 * @param[in] step_x stride_x * number of elements along X processed per workitem (in bytes)
198 * @param[in] stride_y Stride of the tensor in Y dimension (in bytes)
199 * @param[in] step_y stride_y * number of elements along Y processed per workitem (in bytes)
200 * @param[in] stride_z Stride of the tensor in Z dimension (in bytes)
201 * @param[in] step_z stride_z * number of elements along Z processed per workitem (in bytes)
202 *
203 * @return An ImageIterator object
204 */
205ImageIterator update_image_from_tensor3D_iter_offset(uint element_shift, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y, uint stride_z, uint step_z)
206{
207 ImageIterator image_iter;
208 image_iter.element_shift = int(element_shift);
209 image_iter.stride_x = int(stride_x);
210 image_iter.stride_y = int(stride_y);
211 image_iter.current_offset_in_bytes = int(offset_first_element_in_bytes + gl_GlobalInvocationID.x * step_x + gl_GlobalInvocationID.y * step_y + gl_GlobalInvocationID.z * step_z);
212
213 return image_iter;
214}
215
216#define VECTOR_OFFSET(tensor_iter, x) \
217 uint(vector_offset_in_bytes(tensor_iter, int(x)) >> tensor_iter.element_shift)
218
219#define IMAGE_OFFSET(tensor_iter, x, y) \
220 uint(image_offset_in_bytes(tensor_iter, int(x), int(y)) >> tensor_iter.element_shift)
221
222#define TENSOR3D_OFFSET(tensor_iter, x, y, z) \
223 uint(tensor3D_offset_in_bytes(tensor_iter, int(x), int(y), int(z)) >> tensor_iter.element_shift)
224
225#define CURRENT_ITEM_OFFSET(tensor_iter) \
226 uint(tensor_iter.current_offset_in_bytes >> tensor_iter.element_shift)
227
228#define CURRENT_ITEM_OFFSET_IN_BYTES(tensor_iter) \
229 uint(tensor_iter.current_offset_in_bytes)
230
231#define TENSOR_ITERATOR_ADVANCE_IN_BYTES(tensor_iter, n) \
232 tensor_iter.current_offset_in_bytes += int(n)
233
234/** Get the offset of a VectorIterator
235 *
236 * @param[in] vector_iter The VectorIterator object pointed to the starting position of the buffer
237 * @param[in] x Relative X position
238 *
239 * @return The relative offset of the VectorIterator object (in bytes)
240 */
241uint vector_offset_in_bytes(VectorIterator vector_iter, int x)
242{
243 return uint(vector_iter.current_offset_in_bytes + x * vector_iter.stride_x);
244}
245
246/** Get the offset of an ImageIterator
247 *
248 * @param[in] vector_iter The ImageIterator object pointed to the starting position of the buffer
249 * @param[in] x Relative X position
250 * @param[in] y Relative Y position
251 *
252 * @return The relative offset of the ImageIterator object (in bytes)
253 */
254uint image_offset_in_bytes(ImageIterator image_iter, int x, int y)
255{
256 return uint(image_iter.current_offset_in_bytes + x * image_iter.stride_x + y * image_iter.stride_y);
257}
258
259/** Get the offset of a Tensor3DIterator
260 *
261 * @param[in] vector_iter The Tensor3DIterator object pointed to the starting position of the buffer
262 * @param[in] x Relative X position
263 * @param[in] y Relative Y position
264 * @param[in] z Relative Z position
265 *
266 * @return The relative offset of the Tensor3DIterator object (in bytes)
267 */
268uint tensor3D_offset_in_bytes(Tensor3DIterator tensor_iter, int x, int y, int z)
269{
270 return uint(tensor_iter.current_offset_in_bytes + x * tensor_iter.stride_x + y * tensor_iter.stride_y + z * tensor_iter.stride_z);
271}
272
273#define LOAD(tensor_ptr, offset) tensor_ptr[offset]
274#define STORE(tensor_ptr, offset, data) tensor_ptr[offset] = data
275#define LOAD_CURRENT_ITEM(tensor_ptr, tensor_iter) tensor_ptr[CURRENT_ITEM_OFFSET(tensor_iter)]
276#define STORE_CURRENT_ITEM(tensor_ptr, tensor_iter, data) tensor_ptr[CURRENT_ITEM_OFFSET(tensor_iter)] = data
277
278#define VLOAD2(return_type, tensor_ptr, offset) \
279 return_type(LOAD(tensor_ptr, offset), \
280 LOAD(tensor_ptr, (offset) + uint(1)))
281
282#define VSTORE2(tensor_ptr, offset, data) \
283 STORE(tensor_ptr, offset, data[0]); \
284 STORE(tensor_ptr, (offset) + uint(1), data[1])
285
286#define VLOAD2_CURRENT_ITEM(return_type, tensor_ptr, tensor_iter) VLOAD2(return_type, tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
287#define VSTORE2_CURRENT_ITEM(tensor_ptr, tensor_iter, data) VSTORE2(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
288
289#define VLOAD3(return_type, tensor_ptr, offset) \
290 return_type(LOAD(tensor_ptr, offset), \
291 LOAD(tensor_ptr, (offset) + uint(1)), \
292 LOAD(tensor_ptr, (offset) + uint(2)))
293
294#define VSTORE3(tensor_ptr, offset, data) \
295 STORE(tensor_ptr, offset, data[0]); \
296 STORE(tensor_ptr, (offset) + uint(1), data[1]); \
297 STORE(tensor_ptr, (offset) + uint(2), data[2])
298
299#define VLOAD3_CURRENT_ITEM(return_type, tensor_ptr, tensor_iter) VLOAD3(return_type, tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
300#define VSTORE3_CURRENT_ITEM(tensor_ptr, tensor_iter, data) VSTORE3(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
301
302#define VLOAD4(return_type, tensor_ptr, offset) \
303 return_type(LOAD(tensor_ptr, offset), \
304 LOAD(tensor_ptr, (offset) + uint(1)), \
305 LOAD(tensor_ptr, (offset) + uint(2)), \
306 LOAD(tensor_ptr, (offset) + uint(3)))
307
308#define VSTORE4(tensor_ptr, offset, data) \
309 STORE(tensor_ptr, offset, data[0]); \
310 STORE(tensor_ptr, (offset) + uint(1), data[1]); \
311 STORE(tensor_ptr, (offset) + uint(2), data[2]); \
312 STORE(tensor_ptr, (offset) + uint(3), data[3])
313
314#define VLOAD4_CURRENT_ITEM(return_type, tensor_ptr, tensor_iter) VLOAD4(return_type, tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
315#define VSTORE4_CURRENT_ITEM(tensor_ptr, tensor_iter, data) VSTORE4(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
316
317/** Converting the vec4 object to 4 half-precision (16-bits) floating point values and packing into a uvec2 object
318 *
319 * @param[in] data The vec4 object to be packed
320 *
321 * @return The packed uvec2 object
322 */
323highp uvec2 pack4_half(mediump vec4 data)
324{
325 return uvec2(packHalf2x16(data.xy), packHalf2x16(data.zw));
326}
327
328/** Unpacking the uvec2 object to 4 half-precision (16-bits) floating point values and converting to a vec4 object
329 *
330 * @param[in] packed_data The uvec2 object to be unpacked
331 *
332 * @return The unpacked vec4 object
333 */
334mediump vec4 unpack4_half(highp uvec2 packed_data)
335{
336 return vec4(unpackHalf2x16(packed_data.x), unpackHalf2x16(packed_data.y));
337}
338
339/** Converting the vec4[2] object to 8 half-precision (16-bits) floating point values and packing into a uvec4 object
340 *
341 * @param[in] data The vec4[2] object to be packed
342 *
343 * @return The packed uvec4 object
344 */
345highp uvec4 pack8_half(mediump vec4 data[2])
346{
347 return uvec4(packHalf2x16(data[0].xy), packHalf2x16(data[0].zw),
348 packHalf2x16(data[1].xy), packHalf2x16(data[1].zw));
349}
350
351/** Unpacking the uvec4 object to 8 half-precision (16-bits) floating point values and converting to a vec4[2] object
352 *
353 * @param[in] packed_data The uvec4 object to be unpacked
354 *
355 * @return The unpacked vec4[2] object
356 */
357mediump vec4[2] unpack8_half(highp uvec4 packed_data)
358{
359 return vec4[2](vec4(unpackHalf2x16(packed_data.x), unpackHalf2x16(packed_data.y)),
360 vec4(unpackHalf2x16(packed_data.z), unpackHalf2x16(packed_data.w)));
361}
362
363// For half-precision (16-bits) floating point packed into a "uint" element
Joel Liangaa29fde2017-11-15 12:13:59 +0800364#define LOAD_UNPACK2_HALF(tensor_ptr, offset) unpackHalf2x16(uint(LOAD(tensor_ptr, offset)))
Joel Liangf1f3ebd2017-11-10 09:59:19 +0800365#define STORE_PACK2_HALF(tensor_ptr, offset, data) STORE(tensor_ptr, offset, packHalf2x16(data))
366#define LOAD_UNPACK2_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter) LOAD_UNPACK2_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
367#define STORE_PACK2_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter, data) STORE_PACK2_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
368
369#define VLOAD2_UNPACK4_HALF(tensor_ptr, offset) unpack4_half(VLOAD2(uvec2, tensor_ptr, offset))
370#define VSTORE2_PACK4_HALF(tensor_ptr, offset, data) VSTORE2(tensor_ptr, offset, pack4_half(data))
371#define VLOAD2_UNPACK4_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter) VLOAD2_UNPACK4_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
372#define VSTORE2_PACK4_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter, data) VSTORE2_PACK4_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
373
374#define VLOAD4_UNPACK8_HALF(tensor_ptr, offset) unpack8_half(VLOAD4(uvec4, tensor_ptr, offset))
375#define VSTORE4_PACK8_HALF(tensor_ptr, offset, data) VSTORE4(tensor_ptr, offset, pack8_half(data))
376#define VLOAD4_UNPACK8_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter) VLOAD4_UNPACK8_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
377#define VSTORE4_PACK8_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter, data) VSTORE4_PACK8_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
378
379// For half-precision (16-bits) floating point packed into a "uvec2" element
Joel Liangaa29fde2017-11-15 12:13:59 +0800380#define LOAD_UNPACK4_HALF(tensor_ptr, offset) unpack4_half(uvec2(LOAD(tensor_ptr, offset)))
Joel Liangf1f3ebd2017-11-10 09:59:19 +0800381#define STORE_PACK4_HALF(tensor_ptr, offset, data) STORE(tensor_ptr, offset, pack4_half(data))
382#define LOAD_UNPACK4_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter) LOAD_UNPACK4_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
383#define STORE_PACK4_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter, data) STORE_PACK4_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
384
385#define VLOAD2_UNPACK8_HALF(tensor_ptr, offset) unpack8_half(VLOAD2(uvec4, tensor_ptr, offset))
386#define VSTORE2_PACK8_HALF(tensor_ptr, offset, data) VSTORE2(tensor_ptr, offset, pack8_half(data))
387#define VLOAD2_UNPACK8_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter) VLOAD2_UNPACK8_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
388#define VSTORE2_PACK8_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter, data) VSTORE2_PACK8_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
389
390// For half-precision (16-bits) floating point packed into a "uvec4" element
Joel Liangaa29fde2017-11-15 12:13:59 +0800391#define LOAD_UNPACK8_HALF(tensor_ptr, offset) unpack8_half(uvec4(LOAD(tensor_ptr, offset)))
Joel Liangf1f3ebd2017-11-10 09:59:19 +0800392#define STORE_PACK8_HALF(tensor_ptr, offset, data) STORE(tensor_ptr, offset, pack8_half(data))
393#define LOAD_UNPACK8_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter) LOAD_UNPACK8_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter))
394#define STORE_PACK8_CURRENT_ITEM_HALF(tensor_ptr, tensor_iter, data) STORE_PACK8_HALF(tensor_ptr, CURRENT_ITEM_OFFSET(tensor_iter), data)
395
396#endif // ARM_COMPUTE_HELPER_CS_H