Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 1 | /* |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2017, 2018 ARM Limited. |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 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 | layout(local_size_x = LOCAL_SIZE_X, local_size_y = LOCAL_SIZE_Y, local_size_z = LOCAL_SIZE_Z) in; |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 26 | |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 27 | #include "helpers_cs.h" |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 28 | |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 29 | #if defined(DATA_TYPE_FP16) |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 30 | precision mediump float; |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 31 | #endif // DATA_TYPE_FP16 |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 32 | |
| 33 | #ifdef IM2COL_GENERIC |
| 34 | /** This kernel performs a reshaping of the input tensor to a tensor used to perform convolution using GEMM. |
| 35 | * |
| 36 | * @note The data type must be passed at compile time using "#define DATA_TYPE_FP32" |
| 37 | * @note In case biases will be added to the convolution "#define HAS_BIAS" has to be passed to append the final matrix with 1 in each row. |
| 38 | * |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 39 | * @param[in] src_ptr Pointer to the source tensor. Supported data types: F16/F32 |
| 40 | * @param[in] src_attrs The attributes of the source tensor |
| 41 | * @param[out] dst_ptr Pointer to the destination tensor. Supported data types: same as @p src_ptr |
| 42 | * @param[in] dst_attrs The attributes of the destination tensor |
| 43 | * @param[in] filter_depth The depth of the used filter |
| 44 | * @param[in] src_stride_w Stride of the source tensor in W dimension (in bytes). |
| 45 | * @param[in] dst_stride_w Stride of the destination tensor in W dimension (in bytes). |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 46 | */ |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 47 | SHADER_PARAMS_DECLARATION |
| 48 | { |
| 49 | Tensor3DAttributes src_attrs; |
| 50 | ImageAttributes dst_attrs; |
| 51 | uint filter_depth; |
| 52 | uint src_stride_w; |
| 53 | uint dst_stride_w; |
| 54 | }; |
| 55 | |
| 56 | #ifdef DATA_TYPE_FP32 |
| 57 | TENSOR_DECLARATION(1, srcBuffer, float, src_ptr, src_shift, 2, readonly); |
| 58 | TENSOR_DECLARATION(2, dstBuffer, float, dst_ptr, dst_shift, 2, restrict); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 59 | void main(void) |
| 60 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 61 | Tensor3DIterator src_iter = CONVERT_TO_TENSOR3D_ITERATOR_NO_STEP(src_attrs, src_shift); |
| 62 | ImageIterator dst_iter = CONVERT_TO_IMAGE_ITERATOR_NO_STEP(dst_attrs, dst_shift); |
| 63 | |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 64 | uint xc = gl_GlobalInvocationID.x; // x coordinate in the convolved tensor |
| 65 | uint yc = gl_GlobalInvocationID.y; // y coordinate in the convolved tensor |
| 66 | uint ch = gl_GlobalInvocationID.z % filter_depth; // input feature map |
| 67 | uint batch = gl_GlobalInvocationID.z / filter_depth; // the batch |
| 68 | |
| 69 | // Calculate input indeces |
| 70 | uint xi = xc * uint(STRIDE_X) - uint(PAD_X); |
| 71 | uint yi = yc * uint(STRIDE_Y) - uint(PAD_Y); |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 72 | uint input_offset = TENSOR_OFFSET_ADVANCE_IN_BYTES(src_iter, (ch * src_attrs.stride_z) + (batch * src_stride_w)); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 73 | |
| 74 | // Calculate output indeces |
| 75 | uint xo = ch * uint(KERNEL_WIDTH) * uint(KERNEL_HEIGHT); |
| 76 | uint yo = xc + yc * uint(CONVOLVED_WIDTH); // Index of the convolution |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 77 | uint output_offset = TENSOR_OFFSET_ADVANCE_IN_BYTES(dst_iter, (yo * dst_attrs.stride_y) + (batch * dst_stride_w) + xo); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 78 | |
| 79 | // Linearize convolution elements |
| 80 | for(uint y = yi, y_e = yi + uint(KERNEL_HEIGHT); y < y_e; ++y) |
| 81 | { |
| 82 | for(uint x = xi, x_e = xi + uint(KERNEL_WIDTH); x < x_e; ++x) |
| 83 | { |
| 84 | #if PAD_X == 0 && PAD_Y == 0 |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 85 | output_offset = input_offset + ((x * src_attrs.stride_x + y * src_attrs.stride_y) >> uint(2)); |
| 86 | STORE(dst_ptr, output_offset, LOAD(src_ptr, input_offset)); |
| 87 | |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 88 | #else // PAD_X == 0 && PAD_Y == 0 |
| 89 | if(x < 0 || x >= SRC_WIDTH || y < 0 || y >= SRC_HEIGHT) |
| 90 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 91 | STORE(dst_ptr, output_offset, 0.0f); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 92 | } |
| 93 | else |
| 94 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 95 | output_offset = input_offset + (x * srcs_attrs.stride_x + y * src_attrs.stride_y) >> uint(2)); |
| 96 | STORE(dst_ptr, output_offset, LOAD(src_ptr, input_offset)); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 97 | } |
| 98 | #endif // PAD_X == 0 && PAD_Y == 0 |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | #ifdef HAS_BIAS |
| 103 | if(ch == (uint(KERNEL_DEPTH) - 1)) |
| 104 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 105 | STORE(dst_ptr, output_offset, 1.0f); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 106 | } |
| 107 | #endif // HAS_BIAS |
| 108 | } |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 109 | |
| 110 | #elif defined(DATA_TYPE_FP16) |
| 111 | TENSOR_DECLARATION(1, srcBuffer, uint, src_ptr, src_shift, 2, readonly); |
| 112 | TENSOR_DECLARATION(2, dstBuffer, uint, dst_ptr, dst_shift, 2, writeonly); |
| 113 | |
| 114 | void main(void) |
| 115 | { |
| 116 | } |
| 117 | |
| 118 | #else /* DATA_TYPE_FP32 */ |
| 119 | #error Data type not supported |
| 120 | #endif /* DATA_TYPE_FP32 */ |
| 121 | #endif /* IM2COL_GENERIC */ |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 122 | |
| 123 | #ifdef IM2COL_REDUCED |
| 124 | /** This kernel reshapes the tensor's low three dimensions to single row for GEMM operation |
| 125 | * |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 126 | * @note The data type must be passed at compile time using "#define DATA_TYPE_FP16" |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 127 | * @note In case biases will be added in late stage, "#define HAS_BIAS" has to be passed to append the final matrix with 1 in each row. |
| 128 | * |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 129 | * @param[in] src_ptr Pointer to the source tensor. Supported data types: F16/F32 |
| 130 | * @param[in] src_attrs The attributes of the source tensor |
| 131 | * @param[out] dst_ptr Pointer to the destination tensor. Same as @p src_ptr |
| 132 | * @param[in] dst_attrs The attributes of the destination tensor |
| 133 | * @param[in] width The width of the input tensor |
| 134 | * @param[in] height The height of the input tensor |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 135 | */ |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 136 | SHADER_PARAMS_DECLARATION |
| 137 | { |
| 138 | Tensor3DAttributes src_attrs; |
| 139 | VectorAttributes dst_attrs; |
| 140 | uint width; |
| 141 | uint height; |
| 142 | }; |
| 143 | |
| 144 | #ifdef DATA_TYPE_FP32 |
| 145 | TENSOR_DECLARATION(1, srcBuffer, float, src_ptr, src_shift, 2, readonly); |
| 146 | TENSOR_DECLARATION(2, dstBuffer, float, dst_ptr, dst_shift, 2, restrict); |
| 147 | |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 148 | void main(void) |
| 149 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 150 | Tensor3DIterator src_iter = CONVERT_TO_TENSOR3D_ITERATOR(src_attrs, src_shift); |
| 151 | VectorIterator dst_iter = CONVERT_TO_VECTOR_ITERATOR_NO_STEP(dst_attrs, dst_shift); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 152 | |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 153 | uvec3 pos = uvec3(gl_GlobalInvocationID.xyz); |
| 154 | uvec3 size = uvec3(gl_WorkGroupSize.xyz); |
| 155 | uint image_size = width * height; |
| 156 | uint tmp_out_offset = VECTOR_OFFSET(dst_iter, pos.x + pos.y * width + pos.z * image_size); |
| 157 | |
| 158 | STORE(dst_ptr, tmp_out_offset, LOAD_CURRENT_ITEM(src_ptr, src_iter)); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 159 | |
| 160 | #ifdef HAS_BIAS |
| 161 | // If it is the last thread in the 3 dimensional workgroup |
| 162 | if(pos.x == (size.x - 1) && pos.y == (size.y - 1) && pos.z == (size.z - 1)) |
| 163 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 164 | tmp_out_offset += (dst_attrs.stride_x >> uint(2)); |
| 165 | STORE(dst_ptr, tmp_out_offset, 1.f); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 166 | } |
| 167 | #endif // HAS_BIAS |
| 168 | } |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 169 | |
| 170 | #elif defined(DATA_TYPE_FP16) |
| 171 | |
| 172 | #if defined(IM2COL_REDUCED_8X) |
| 173 | TENSOR_DECLARATION(1, srcBuffer, uvec4, src_ptr, src_shift, 4, readonly); |
| 174 | TENSOR_DECLARATION(2, dstBuffer, uvec4, dst_ptr, dst_shift, 4, restrict); |
| 175 | #elif defined(IM2COL_REDUCED_4X) /* IM2COL_REDUCED_8X */ |
| 176 | TENSOR_DECLARATION(1, srcBuffer, uvec2, src_ptr, src_shift, 3, readonly); |
| 177 | TENSOR_DECLARATION(2, dstBuffer, uvec2, dst_ptr, dst_shift, 3, restrict); |
| 178 | #else /* IM2COL_REDUCED_8X */ |
| 179 | TENSOR_DECLARATION(1, srcBuffer, uint, src_ptr, src_shift, 2, readonly); |
| 180 | TENSOR_DECLARATION(2, dstBuffer, uint, dst_ptr, dst_shift, 2, restrict); |
| 181 | #endif /* IM2COL_REDUCED_8X */ |
| 182 | |
| 183 | #if defined(IM2COL_REDUCED_GENERIC) |
| 184 | void main(void) |
| 185 | { |
| 186 | Tensor3DIterator src_iter = CONVERT_TO_TENSOR3D_ITERATOR(src_attrs, src_shift); |
| 187 | Tensor3DIterator src_nostep_iter = CONVERT_TO_TENSOR3D_ITERATOR_NO_STEP(src_attrs, src_shift); |
| 188 | VectorIterator dst_iter = CONVERT_TO_VECTOR_ITERATOR_NO_STEP(dst_attrs, dst_shift); |
| 189 | |
| 190 | uvec3 pos = uvec3(gl_GlobalInvocationID.xyz); |
| 191 | uvec3 size = uvec3(gl_WorkGroupSize.xyz); |
| 192 | uint image_size = width * height; |
| 193 | uint element_count = src_attrs.step_x / src_attrs.stride_x; |
| 194 | uint tmp_out_offset = VECTOR_OFFSET(dst_iter, pos.x * element_count + pos.y * width + pos.z * image_size); |
| 195 | uint width_fp16 = (width + uint(1)) >> uint(1); |
| 196 | uint tmp; |
| 197 | |
| 198 | // odd width |
| 199 | if(width % uint(2) != uint(0)) |
| 200 | { |
| 201 | // even row |
| 202 | if((pos.y + pos.z * height) % uint(2) == uint(0)) |
| 203 | { |
| 204 | tmp = LOAD_CURRENT_ITEM(src_ptr, src_iter); |
| 205 | STORE(dst_ptr, tmp_out_offset, tmp); |
| 206 | } |
| 207 | else |
| 208 | { |
| 209 | // special op |
| 210 | uint tmpleft = uint(0); |
| 211 | uint tmpright = uint(0); |
| 212 | tmpright = LOAD_CURRENT_ITEM(src_ptr, src_iter); //right half |
| 213 | if(pos.x == uint(0)) |
| 214 | { |
| 215 | tmpleft = LOAD(src_ptr, TENSOR3D_OFFSET(src_nostep_iter, int(width), int(pos.y) - 1, int(pos.z))); //left half |
| 216 | tmpright = (tmpleft & uint(0xffff)) + (tmpright << uint(16)); |
| 217 | } |
| 218 | else |
| 219 | { |
| 220 | tmpleft = LOAD(src_ptr, TENSOR3D_OFFSET(src_nostep_iter, (int(pos.x) - 1) * int(element_count), int(pos.y), int(pos.z))); |
| 221 | tmpright = ((tmpleft >> uint(16)) + (tmpright << uint(16))); |
| 222 | } |
| 223 | STORE(dst_ptr, tmp_out_offset, tmpright); |
| 224 | } |
| 225 | } |
| 226 | else |
| 227 | { |
| 228 | tmp = LOAD_CURRENT_ITEM(src_ptr, src_iter); |
| 229 | STORE(dst_ptr, tmp_out_offset, tmp); |
| 230 | |
| 231 | #ifdef HAS_BIAS |
| 232 | // If it is the last thread in the 3 dimensional workgroup |
| 233 | if(pos.x == (size.x - 1) && pos.y == (size.y - 1) && pos.z == (size.z - 1)) |
| 234 | { |
| 235 | tmp_out_offset += (dst_attrs.stride_x >> dst_shift); |
| 236 | |
| 237 | // FIXME: need odd/even detection for tmp_out_offset? |
| 238 | mediump vec2 bias_vec = vec2(1.0f, 1.0f); |
| 239 | STORE_PACK2_HALF(dst_ptr, tmp_out_offset, bias_vec); |
| 240 | } |
| 241 | #endif // HAS_BIAS |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | #else /* IM2COL_REDUCED_GENERIC */ |
| 246 | void main(void) |
| 247 | { |
| 248 | Tensor3DIterator src_iter = CONVERT_TO_TENSOR3D_ITERATOR(src_attrs, src_shift); |
| 249 | VectorIterator dst_iter = CONVERT_TO_VECTOR_ITERATOR_NO_STEP(dst_attrs, dst_shift); |
| 250 | |
| 251 | uvec3 pos = uvec3(gl_GlobalInvocationID.xyz); |
| 252 | #if defined(IM2COL_REDUCED_8X) |
| 253 | uint tmp_out_offset = VECTOR_OFFSET(dst_iter, pos.x * uint(8) + pos.y * width + pos.z * uint(IMAGE_SIZE)); |
| 254 | uvec4 tmp = LOAD_CURRENT_ITEM(src_ptr, src_iter); |
| 255 | STORE(dst_ptr, tmp_out_offset, tmp); |
| 256 | #elif defined(IM2COL_REDUCED_4X) /* IM2COL_REDUCED_8X */ |
| 257 | uint tmp_out_offset = VECTOR_OFFSET(dst_iter, pos.x * uint(4) + pos.y * width + pos.z * uint(IMAGE_SIZE)); |
| 258 | uvec2 tmp = LOAD_CURRENT_ITEM(src_ptr, src_iter); |
| 259 | STORE(dst_ptr, tmp_out_offset, tmp); |
| 260 | #else /* IM2COL_REDUCED_8X */ |
| 261 | uint tmp_out_offset = VECTOR_OFFSET(dst_iter, pos.x * uint(2) + pos.y * width + pos.z * uint(IMAGE_SIZE)); |
| 262 | uint tmp = LOAD_CURRENT_ITEM(src_ptr, src_iter); |
| 263 | STORE(dst_ptr, tmp_out_offset, tmp); |
| 264 | #endif /* IM2COL_REDUCED_8X */ |
| 265 | } |
| 266 | #endif /* IM2COL_REDUCED_GENERIC */ |
| 267 | #else /* DATA_TYPE_FP32 */ |
| 268 | #error Data type not supported |
| 269 | #endif /* DATA_TYPE_FP32 */ |
| 270 | #endif /* IM2COL_REDUCED */ |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 271 | |
| 272 | #ifdef COL2IM |
| 273 | /** This kernel performs a reshaping of the output of the convolution layer. |
| 274 | * |
| 275 | * @note The data type must be passed at compile time using "#define DATA_TYPE_FP32" |
| 276 | * |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 277 | * @param[in] src_ptr Pointer to the source tensor. Supported data types: F16/F32 |
| 278 | * @param[in] src_attrs The attributes of the source tensor |
| 279 | * @param[out] dst_ptr Pointer to the destination tensor. Supported data types: same as @p src_ptr |
| 280 | * @param[in] dst_attrs The attributes of the destination tensor |
| 281 | * @param[in] width The width of output convolved dimensions |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 282 | */ |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 283 | SHADER_PARAMS_DECLARATION |
| 284 | { |
| 285 | ImageAttributes src_attrs; |
| 286 | Tensor3DAttributes dst_attrs; |
| 287 | uint width; |
| 288 | }; |
| 289 | |
| 290 | #ifdef DATA_TYPE_FP32 |
| 291 | TENSOR_DECLARATION(1, srcBuffer, float, src_ptr, src_shift, 2, readonly); |
| 292 | TENSOR_DECLARATION(2, dstBuffer, float, dst_ptr, dst_shift, 2, restrict); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 293 | void main(void) |
| 294 | { |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 295 | ImageIterator src_iter = CONVERT_TO_IMAGE_ITERATOR(src_attrs, src_shift); |
| 296 | Tensor3DIterator dst_iter = CONVERT_TO_TENSOR3D_ITERATOR(dst_attrs, dst_shift); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 297 | |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 298 | uvec2 pos = uvec2(gl_GlobalInvocationID.xy); |
| 299 | uint tmp_out_offset = TENSOR3D_OFFSET(dst_iter, pos.y % width, pos.y / width, pos.x); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 300 | |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 301 | STORE(dst_ptr, tmp_out_offset, LOAD_CURRENT_ITEM(src_ptr, src_iter)); |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 302 | } |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 303 | |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 304 | #elif defined(DATA_TYPE_FP16) |
| 305 | |
| 306 | #else /* DATA_TYPE_FP32 */ |
Anthony Barbier | 7068f99 | 2017-10-26 15:23:08 +0100 | [diff] [blame] | 307 | #error Data type not supported |
zhenglin | 57b2010 | 2018-01-05 14:39:50 +0800 | [diff] [blame^] | 308 | #endif /* DATA_TYPE_FP32 */ |
| 309 | #endif /* COL2IM */ |