Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Gian Marco Iodice | ff1fe3e | 2021-01-02 09:58:51 +0000 | [diff] [blame] | 2 | * Copyright (c) 2016-2021 Arm Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +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 | #include "arm_compute/core/CL/CLKernelLibrary.h" |
| 25 | |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 26 | #include "arm_compute/core/CL/CLHelpers.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 27 | #include "arm_compute/core/Error.h" |
| 28 | #include "arm_compute/core/Utils.h" |
Matthew Bentham | 758b5ba | 2020-03-05 23:37:48 +0000 | [diff] [blame] | 29 | #include "support/StringSupport.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 30 | |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 31 | #include <algorithm> |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 32 | #include <array> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 33 | #include <fstream> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 34 | #include <utility> |
| 35 | #include <vector> |
| 36 | |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 37 | #ifdef ARM_COMPUTE_COMPRESSED_KERNELS |
| 38 | #include <zlib.h> |
| 39 | |
| 40 | namespace |
| 41 | { |
| 42 | /* Decoding table */ |
| 43 | constexpr std::array<uint8_t, 256> b64_invtab = |
| 44 | { |
| 45 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 46 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 47 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, |
| 48 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, |
| 49 | 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 50 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, |
| 51 | 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, |
| 52 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, |
| 53 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 54 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 55 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 56 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 57 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 58 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 59 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 60 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 61 | }; |
| 62 | |
| 63 | /** Decode a base64 encoded string |
| 64 | * |
| 65 | * @param[in] str Base64 encoded string to decode |
| 66 | * |
| 67 | * @return The decode string in case of a valid, non-empty string otherwise an empty string |
| 68 | */ |
| 69 | std::string decode_base64(const std::string &str) |
| 70 | { |
| 71 | constexpr const char pad_char = '='; |
| 72 | |
| 73 | // Handle empty string |
| 74 | if(str.empty()) |
| 75 | { |
| 76 | return {}; |
| 77 | } |
| 78 | |
| 79 | // Base64 encoded string has size multiple of 4 |
| 80 | if(str.length() % 4) |
| 81 | { |
| 82 | return {}; |
| 83 | } |
| 84 | |
| 85 | // |
| 86 | // Check encoded string padding |
| 87 | std::size_t padding = (str.rbegin()[0] == pad_char) + (str.rbegin()[1] == pad_char); |
| 88 | const int str_len = str.size(); |
| 89 | |
| 90 | // Reserve memory for the decoded string |
| 91 | // Note each 4 consecutive elements of 6-bit encode 3 bytes |
| 92 | std::string dec_b64; |
| 93 | dec_b64.reserve(((str_len / 4) * 3)); |
| 94 | |
| 95 | // Block decoding function (exclude padding) |
| 96 | int c = 0; |
| 97 | const int end = str_len - 4 - padding; |
| 98 | for(; c <= end; c += 4) |
| 99 | { |
| 100 | const int byte0 = b64_invtab[str[c]]; |
| 101 | const int byte1 = b64_invtab[str[c + 1]]; |
| 102 | const int byte2 = b64_invtab[str[c + 2]]; |
| 103 | const int byte3 = b64_invtab[str[c + 3]]; |
| 104 | |
| 105 | dec_b64.push_back((byte0 << 2) | (byte1 >> 4)); |
| 106 | dec_b64.push_back((byte1 << 4) | (byte2 >> 2)); |
| 107 | dec_b64.push_back((byte2 << 6) | (byte3)); |
| 108 | } |
| 109 | |
| 110 | // Last step that might contain padding symbols |
| 111 | if(padding == 1) |
| 112 | { |
| 113 | const int byte0 = b64_invtab[str[c]]; |
| 114 | const int byte1 = b64_invtab[str[c + 1]]; |
| 115 | const int byte2 = b64_invtab[str[c + 2]]; |
| 116 | |
| 117 | dec_b64.push_back((byte0 << 2) | (byte1 >> 4)); |
| 118 | dec_b64.push_back((byte1 << 4) | (byte2 >> 2)); |
| 119 | } |
| 120 | else if(padding == 2) |
| 121 | { |
| 122 | const int byte0 = b64_invtab[str[c]]; |
| 123 | const int byte1 = b64_invtab[str[c + 1]]; |
| 124 | |
| 125 | dec_b64.push_back((byte0 << 2) | (byte1 >> 4)); |
| 126 | } |
| 127 | |
| 128 | return dec_b64; |
| 129 | } |
| 130 | |
| 131 | /** Decompress a zlib compressed string |
| 132 | * |
| 133 | * @param[in] str ZLib compressed string |
| 134 | * |
| 135 | * @return The decompressed string if successful, otherwise false. |
| 136 | */ |
| 137 | std::string decompress_zlib(const std::string &str) |
| 138 | { |
| 139 | // Create and initialize decompression stream |
| 140 | z_stream ds{}; |
| 141 | if(inflateInit(&ds) != Z_OK) |
| 142 | { |
| 143 | return std::string(); |
| 144 | } |
| 145 | ds.avail_in = str.size(); |
| 146 | ds.next_in = (Bytef *)str.data(); |
| 147 | |
| 148 | // Roll-over the string using a buffer and decompress |
| 149 | int status = Z_OK; |
| 150 | char roll_buff[16384]; |
| 151 | std::string inflated_str; |
| 152 | do |
| 153 | { |
| 154 | ds.avail_out = sizeof(roll_buff); |
| 155 | ds.next_out = reinterpret_cast<Bytef *>(roll_buff); |
| 156 | |
| 157 | status = inflate(&ds, 0); |
| 158 | if(inflated_str.size() < ds.total_out) |
| 159 | { |
| 160 | inflated_str.append(roll_buff, ds.total_out - inflated_str.size()); |
| 161 | } |
| 162 | } |
| 163 | while(status == Z_OK); |
| 164 | |
| 165 | // Finalize decompression stream |
| 166 | inflateEnd(&ds); |
| 167 | if(status != Z_STREAM_END) |
| 168 | { |
| 169 | return std::string(); |
| 170 | } |
| 171 | |
| 172 | return inflated_str; |
| 173 | } |
| 174 | } // namespace |
| 175 | #endif /* ARM_COMPUTE_COMPRESSED_KERNELS */ |
| 176 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 177 | using namespace arm_compute; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 178 | const std::map<std::string, std::string> CLKernelLibrary::_kernel_program_map = |
| 179 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 180 | { "activation_layer", "activation_layer.cl" }, |
Manuel Bottini | 30dbeef | 2019-06-26 16:23:03 +0100 | [diff] [blame] | 181 | { "activation_layer_quant", "activation_layer_quant.cl" }, |
| 182 | { "activation_layer_quant_f32", "activation_layer_quant.cl" }, |
Manuel Bottini | 7b9998d | 2019-10-21 17:59:07 +0100 | [diff] [blame] | 183 | { "arg_min_max_x", "arg_min_max.cl" }, |
| 184 | { "arg_min_max_y", "arg_min_max.cl" }, |
| 185 | { "arg_min_max_z", "arg_min_max.cl" }, |
| 186 | { "arg_min_max_w", "arg_min_max.cl" }, |
Michalis Spyrou | f1addb6 | 2018-09-11 11:16:47 +0100 | [diff] [blame] | 187 | { "batch_to_space_nchw", "batch_to_space.cl" }, |
| 188 | { "batch_to_space_static_nchw", "batch_to_space.cl" }, |
| 189 | { "batch_to_space_nhwc", "batch_to_space.cl" }, |
| 190 | { "batch_to_space_static_nhwc", "batch_to_space.cl" }, |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 191 | { "batchnormalization_layer_nchw", "batchnormalization_layer.cl" }, |
| 192 | { "batchnormalization_layer_nhwc", "batchnormalization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 193 | { "bitwise_or", "bitwise_op.cl" }, |
| 194 | { "bitwise_and", "bitwise_op.cl" }, |
| 195 | { "bitwise_xor", "bitwise_op.cl" }, |
| 196 | { "bitwise_not", "bitwise_op.cl" }, |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 197 | { "bounding_box_transform", "bounding_box_transform.cl" }, |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 198 | { "bounding_box_transform_quantized", "bounding_box_transform_quantized.cl" }, |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 199 | { "channel_shuffle_nchw", "channel_shuffle.cl" }, |
Gian Marco Iodice | 8bab0ee | 2018-09-13 11:51:56 +0100 | [diff] [blame] | 200 | { "channel_shuffle_nhwc", "channel_shuffle.cl" }, |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 201 | { "compare_equal", "comparisons.cl" }, |
| 202 | { "compare_equal_quantized", "comparisons.cl" }, |
| 203 | { "compare_notequal", "comparisons.cl" }, |
| 204 | { "compare_notequal_quantized", "comparisons.cl" }, |
| 205 | { "compare_greater", "comparisons.cl" }, |
| 206 | { "compare_greater_quantized", "comparisons.cl" }, |
| 207 | { "compare_greaterequal", "comparisons.cl" }, |
| 208 | { "compare_greaterequal_quantized", "comparisons.cl" }, |
| 209 | { "compare_less", "comparisons.cl" }, |
| 210 | { "compare_less_quantized", "comparisons.cl" }, |
| 211 | { "compare_lessequal", "comparisons.cl" }, |
| 212 | { "compare_lessequal_quantized", "comparisons.cl" }, |
Vidhya Sudhan Loganathan | 338595b | 2019-06-28 14:09:53 +0100 | [diff] [blame] | 213 | { "concatenate", "concatenate.cl" }, |
Michalis Spyrou | 55b3d12 | 2018-05-09 09:59:23 +0100 | [diff] [blame] | 214 | { "concatenate_width", "concatenate.cl" }, |
Pablo Tello | 6a14adb | 2019-03-05 17:33:08 +0000 | [diff] [blame] | 215 | { "concatenate_height", "concatenate.cl" }, |
Michele Di Giorgio | 27400b9 | 2018-11-01 13:44:05 +0000 | [diff] [blame] | 216 | { "concatenate_width_x2", "concatenate.cl" }, |
| 217 | { "concatenate_width_x4", "concatenate.cl" }, |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 218 | { "col2im", "col2im.cl" }, |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 219 | { "convert_depth_down", "depth_convert.cl" }, |
| 220 | { "convert_depth_up", "depth_convert.cl" }, |
| 221 | { "convert_fc_weights", "convert_fc_weights.cl" }, |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 222 | { "copy_tensor", "copy_tensor.cl" }, |
George Wort | 894066d | 2019-02-15 15:12:52 +0000 | [diff] [blame] | 223 | { "crop_tensor", "crop_tensor.cl" }, |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 224 | { "deconvolution_reshape", "deconvolution_layer.cl" }, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 225 | { "deconvolution_upsample", "deconvolution_layer.cl" }, |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 226 | { "depthwise_convolution_3x3", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 227 | { "depthwise_convolution_3x3_f16", "depthwise_convolution.cl" }, |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 228 | { "depthwise_convolution_3x3_nhwc", "depthwise_convolution.cl" }, |
| 229 | { "depthwise_convolution_3x3_nhwc_stride1", "depthwise_convolution.cl" }, |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 230 | { "dwc_MxN_native_fp_nhwc", "depthwise_convolution.cl" }, |
Michele Di Giorgio | a046e16 | 2019-10-08 09:36:26 +0100 | [diff] [blame] | 231 | { "dwc_MxN_native_quantized8_nhwc", "depthwise_convolution_quantized.cl" }, |
Michele Di Giorgio | df4cf57 | 2019-10-09 15:32:39 +0100 | [diff] [blame] | 232 | { "dwc_3x3_native_quantized8_nchw", "depthwise_convolution_quantized.cl" }, |
| 233 | { "dwc_3x3_native_quantized8_dot8_nchw", "depthwise_convolution_quantized.cl" }, |
| 234 | { "dwc_3x3_reshaped_quantized8_nhwc", "depthwise_convolution_quantized.cl" }, |
| 235 | { "dwc_3x3_reshaped_quantized8_stride1_nhwc", "depthwise_convolution_quantized.cl" }, |
| 236 | { "dwc_3x3_reshaped_quantized8_dot8_stride1_nhwc", "depthwise_convolution_quantized.cl" }, |
Michalis Spyrou | 649962c | 2019-05-22 11:11:55 +0100 | [diff] [blame] | 237 | { "depth_to_space_nchw", "depth_to_space.cl" }, |
| 238 | { "depth_to_space_nhwc", "depth_to_space.cl" }, |
Michele Di Giorgio | 3ebef32 | 2018-02-21 10:02:58 +0000 | [diff] [blame] | 239 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f16", "depthwise_convolution.cl" }, |
| 240 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f16", "depthwise_convolution.cl" }, |
| 241 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f32", "depthwise_convolution.cl" }, |
| 242 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f32", "depthwise_convolution.cl" }, |
giuros01 | 6d10996 | 2019-01-07 17:47:19 +0000 | [diff] [blame] | 243 | { "depthwise_convolution_reshape_weights", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 244 | { "dequantization_layer", "dequantization_layer.cl" }, |
Michalis Spyrou | 3f632f3 | 2019-08-22 16:52:00 +0100 | [diff] [blame] | 245 | { "dequantization_layer_per_channel_nhwc", "dequantization_layer.cl" }, |
| 246 | { "dequantization_layer_per_channel_nchw", "dequantization_layer.cl" }, |
Gian Marco Iodice | ff1fe3e | 2021-01-02 09:58:51 +0000 | [diff] [blame] | 247 | { "direct_convolution_nhwc", "direct_convolution.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 248 | { "direct_convolution1x1", "direct_convolution1x1.cl" }, |
Gian Marco Iodice | 1c8409d | 2017-09-06 17:24:25 +0100 | [diff] [blame] | 249 | { "direct_convolution1x1_f32_bifrost", "direct_convolution1x1.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 250 | { "direct_convolution3x3", "direct_convolution3x3.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 251 | { "direct_convolution3x3_f32_bifrost", "direct_convolution3x3.cl" }, |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 252 | { "direct_convolution5x5", "direct_convolution5x5.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 253 | { "direct_convolution5x5_f32_bifrost", "direct_convolution5x5.cl" }, |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 254 | { "direct_convolution_quantized", "direct_convolution_quantized.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 255 | { "elementwise_operation_ADD", "elementwise_operation.cl" }, |
| 256 | { "elementwise_operation_SUB", "elementwise_operation.cl" }, |
| 257 | { "elementwise_operation_MAX", "elementwise_operation.cl" }, |
| 258 | { "elementwise_operation_MIN", "elementwise_operation.cl" }, |
| 259 | { "elementwise_operation_DIV", "elementwise_operation.cl" }, |
| 260 | { "elementwise_operation_SQUARED_DIFF", "elementwise_operation.cl" }, |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 261 | { "elementwise_operation_POWER", "elementwise_operation.cl" }, |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 262 | { "elementwise_operation_PRELU", "elementwise_operation.cl" }, |
Sang-Hoon Park | 75eea33 | 2020-11-13 13:44:13 +0000 | [diff] [blame] | 263 | { "elementwise_operation_AND", "elementwise_operation.cl" }, |
| 264 | { "elementwise_operation_OR", "elementwise_operation.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 265 | { "elementwise_operation_ADD_quantized", "elementwise_operation_quantized.cl" }, |
| 266 | { "elementwise_operation_SUB_quantized", "elementwise_operation_quantized.cl" }, |
| 267 | { "elementwise_operation_MAX_quantized", "elementwise_operation_quantized.cl" }, |
| 268 | { "elementwise_operation_MIN_quantized", "elementwise_operation_quantized.cl" }, |
| 269 | { "elementwise_operation_DIV_quantized", "elementwise_operation_quantized.cl" }, |
| 270 | { "elementwise_operation_SQUARED_DIFF_quantized", "elementwise_operation_quantized.cl" }, |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 271 | { "elementwise_operation_PRELU_quantized", "elementwise_operation_quantized.cl" }, |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 272 | { "elementwise_unary", "elementwise_unary.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 273 | { "fft_digit_reverse_axis_0", "fft_digit_reverse.cl" }, |
| 274 | { "fft_digit_reverse_axis_1", "fft_digit_reverse.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 275 | { "fft_radix_2_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 276 | { "fft_radix_2_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 277 | { "fft_radix_2_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 278 | { "fft_radix_2_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 279 | { "fft_radix_3_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 280 | { "fft_radix_3_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 281 | { "fft_radix_3_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 282 | { "fft_radix_3_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 283 | { "fft_radix_4_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 284 | { "fft_radix_4_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 285 | { "fft_radix_4_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 286 | { "fft_radix_4_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 287 | { "fft_radix_5_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 288 | { "fft_radix_5_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 289 | { "fft_radix_5_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 290 | { "fft_radix_5_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 291 | { "fft_radix_7_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 292 | { "fft_radix_7_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 293 | { "fft_radix_7_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 294 | { "fft_radix_7_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 295 | { "fft_radix_8_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 296 | { "fft_radix_8_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 297 | { "fft_radix_8_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 298 | { "fft_radix_8_axis_1", "fft.cl" }, |
| 299 | { "fft_scale_conj", "fft_scale.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 300 | { "fill_image_borders_constant", "fill_border.cl" }, |
| 301 | { "fill_image_borders_replicate", "fill_border.cl" }, |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 302 | { "floor_layer", "floor.cl" }, |
Manuel Bottini | 2732cca | 2019-05-28 11:44:41 +0100 | [diff] [blame] | 303 | { "fuse_batchnormalization_layer", "batchnormalization_layer.cl" }, |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 304 | { "gather", "gather.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 305 | { "gemm_ma_f16", "gemm.cl" }, |
| 306 | { "gemm_ma_f32", "gemm.cl" }, |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 307 | { "gemm_mv", "gemv.cl" }, |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 308 | { "gemm_mv_quantized", "gemv.cl" }, |
SiCong Li | 4abc9d1 | 2020-10-28 14:19:28 +0000 | [diff] [blame] | 309 | { "gemm_mm_interleaved_transposed_f16", "gemm_v1.cl" }, |
| 310 | { "gemm_mm_interleaved_transposed_f16_acc32", "gemm_v1.cl" }, |
| 311 | { "gemm_mm_interleaved_transposed_f16_bifrost", "gemm_v1.cl" }, |
| 312 | { "gemm_mm_interleaved_transposed_f32", "gemm_v1.cl" }, |
| 313 | { "gemm_mm_interleaved_transposed_f32_bifrost", "gemm_v1.cl" }, |
| 314 | { "gemm_mm_floating_point", "gemm_v1.cl" }, |
| 315 | { "gemm_mm_floating_point_f16_bifrost", "gemm_v1.cl" }, |
| 316 | { "gemm_mm_floating_point_f16_bifrost_acc32", "gemm_v1.cl" }, |
| 317 | { "gemm_mm_floating_point_f32_bifrost", "gemm_v1.cl" }, |
| 318 | { "gemm_mm_floating_point_f32_bifrost_1000", "gemm_v1.cl" }, |
giuros01 | b3204e7 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 319 | { "gemm_mm_native", "gemm.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 320 | { "gemm_mm_reshaped_lhs_nt_rhs_t", "gemm.cl" }, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 321 | { "gemm_mm_reshaped_lhs_nt_rhs_t_texture", "gemm.cl" }, |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 322 | { "gemm_mm_reshaped_lhs_t_rhs_nt", "gemm.cl" }, |
Gian Marco Iodice | e3a849a | 2020-06-10 17:59:30 +0100 | [diff] [blame] | 323 | { "gemm_mm_reshaped_lhs_t_rhs_nt_texture", "gemm.cl" }, |
Gian Marco Iodice | ba5e096 | 2019-03-11 12:17:44 +0000 | [diff] [blame] | 324 | { "gemm_mm_reshaped_only_rhs_nt", "gemm.cl" }, |
Gian Marco Iodice | 781cba7 | 2020-06-19 16:56:57 +0100 | [diff] [blame] | 325 | { "gemm_mm_reshaped_only_rhs_nt_texture", "gemm.cl" }, |
Gian Marco Iodice | adc5395 | 2019-02-15 11:10:31 +0000 | [diff] [blame] | 326 | { "gemm_mm_reshaped_only_rhs_t", "gemm.cl" }, |
Gian Marco Iodice | 781cba7 | 2020-06-19 16:56:57 +0100 | [diff] [blame] | 327 | { "gemm_mm_reshaped_only_rhs_t_texture", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 328 | { "gemm_lc_vm_f32", "gemm.cl" }, |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 329 | { "gemm_reshape_lhs_matrix_nt", "gemm.cl" }, |
Gian Marco Iodice | 08ddd7b | 2018-12-19 10:01:18 +0000 | [diff] [blame] | 330 | { "gemm_reshape_lhs_matrix_t", "gemm.cl" }, |
Gian Marco Iodice | 3b0a265 | 2018-12-07 11:18:09 +0000 | [diff] [blame] | 331 | { "gemm_reshape_rhs_matrix_nt", "gemm.cl" }, |
| 332 | { "gemm_reshape_rhs_matrix_t", "gemm.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 333 | { "gemmlowp_matrix_a_reduction", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 334 | { "gemmlowp_matrix_a_reduction_dot8", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 335 | { "gemmlowp_matrix_b_reduction", "gemmlowp.cl" }, |
Gian Marco Iodice | e751062 | 2019-06-03 17:28:17 +0100 | [diff] [blame] | 336 | { "gemmlowp_mm_native", "gemmlowp.cl" }, |
Gian Marco Iodice | db63b9c | 2019-01-17 09:47:04 +0000 | [diff] [blame] | 337 | { "gemmlowp_mm_reshaped_lhs_nt_rhs_t", "gemmlowp.cl" }, |
Gian Marco Iodice | 62251f7 | 2019-03-11 16:07:12 +0000 | [diff] [blame] | 338 | { "gemmlowp_mm_reshaped_only_rhs_t", "gemmlowp.cl" }, |
Michele Di Giorgio | b54ba28 | 2020-01-14 15:31:55 +0000 | [diff] [blame] | 339 | { "gemmlowp_mm_reshaped_only_rhs_t_fused_output_stage_fixedpoint", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 340 | { "gemmlowp_offset_contribution", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 341 | { "gemmlowp_offset_contribution_quantize_down", "gemmlowp.cl" }, |
| 342 | { "gemmlowp_offset_contribution_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 343 | { "gemmlowp_output_stage_quantize_down", "gemmlowp.cl" }, |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 344 | { "gemmlowp_output_stage_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Manuel Bottini | 9c9b70b | 2019-07-01 17:35:56 +0100 | [diff] [blame] | 345 | { "gemmlowp_output_stage_quantize_down_fixedpoint_qsymm16", "gemmlowp.cl" }, |
Georgios Pinitas | 51e53a3 | 2018-10-22 13:49:08 +0100 | [diff] [blame] | 346 | { "gemmlowp_output_stage_quantize_down_float", "gemmlowp.cl" }, |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 347 | { "generate_proposals_compute_all_anchors", "generate_proposals.cl" }, |
Michele Di Giorgio | 6b612f5 | 2019-09-05 12:30:22 +0100 | [diff] [blame] | 348 | { "generate_proposals_compute_all_anchors_quantized", "generate_proposals_quantized.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 349 | { "im2col1x1_stridex1_nchw", "im2col.cl" }, |
| 350 | { "im2col3x3_nchw", "im2col.cl" }, |
| 351 | { "im2col5x5_nchw", "im2col.cl" }, |
| 352 | { "im2col11x11_padx0_pady0_nchw", "im2col.cl" }, |
| 353 | { "im2col_generic_nchw", "im2col.cl" }, |
| 354 | { "im2col_generic_padx0_pady0_nchw", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 355 | { "im2col3x3_nhwc", "im2col.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 356 | { "im2col9x9_nhwc", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 357 | { "im2col_generic_nhwc", "im2col.cl" }, |
Manuel Bottini | 79f88e6 | 2019-09-18 15:02:53 +0100 | [diff] [blame] | 358 | { "instance_normalization", "instance_normalization.cl" }, |
Michalis Spyrou | 5538d34 | 2018-11-14 08:10:13 +0000 | [diff] [blame] | 359 | { "l2_normalize_x", "l2_normalize.cl" }, |
| 360 | { "l2_normalize_y", "l2_normalize.cl" }, |
| 361 | { "l2_normalize_z", "l2_normalize.cl" }, |
Gian Marco Iodice | 4d81d75 | 2020-07-14 15:05:31 +0100 | [diff] [blame] | 362 | { "max_unpooling_layer_2", "unpooling_layer.cl" }, |
Michele Di Giorgio | 5b48ad7 | 2019-06-04 18:43:35 +0100 | [diff] [blame] | 363 | { "mean_stddev_normalization", "mean_stddev_normalization.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 364 | { "memset", "memset.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 365 | { "minmax_layer", "minmax_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 366 | { "non_max_suppression", "nonmax.cl" }, |
| 367 | { "normalization_layer_cross_map", "normalization_layer.cl" }, |
Michele Di Giorgio | 9d3a831 | 2018-11-20 12:31:24 +0000 | [diff] [blame] | 368 | { "normalization_layer_in_map_nchw", "normalization_layer.cl" }, |
| 369 | { "normalization_layer_in_map_nhwc", "normalization_layer.cl" }, |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 370 | { "normalize_planar_yuv_layer_nchw", "normalize_planar_yuv_layer.cl" }, |
| 371 | { "normalize_planar_yuv_layer_nhwc", "normalize_planar_yuv_layer.cl" }, |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 372 | { "normalize_planar_yuv_layer_q8_nchw", "normalize_planar_yuv_layer_quantized.cl" }, |
| 373 | { "normalize_planar_yuv_layer_q8_nhwc", "normalize_planar_yuv_layer_quantized.cl" }, |
Giorgio Arena | 5c4a8e9 | 2019-08-28 17:55:07 +0100 | [diff] [blame] | 374 | { "pad_layer_constant", "pad_layer.cl" }, |
| 375 | { "pad_layer_symmetric_reflect", "pad_layer.cl" }, |
shubham | e1a4e37 | 2019-01-07 21:37:55 +0530 | [diff] [blame] | 376 | { "permute", "permute.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 377 | { "pixelwise_mul_complex", "pixelwise_mul_float.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 378 | { "pixelwise_mul_float", "pixelwise_mul_float.cl" }, |
| 379 | { "pixelwise_mul_int", "pixelwise_mul_int.cl" }, |
Georgios Pinitas | bf28a3c | 2018-09-18 14:34:48 +0100 | [diff] [blame] | 380 | { "pixelwise_mul_quantized", "pixelwise_mul_int.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 381 | { "pooling_layer_2", "pooling_layer.cl" }, |
| 382 | { "pooling_layer_3", "pooling_layer.cl" }, |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 383 | { "pooling_layer_optimized_3", "pooling_layer.cl" }, |
Georgios Pinitas | ce09314 | 2017-06-19 16:11:53 +0100 | [diff] [blame] | 384 | { "pooling_layer_7", "pooling_layer.cl" }, |
Michalis Spyrou | e74b201 | 2018-04-18 09:49:16 +0100 | [diff] [blame] | 385 | { "pooling_layer_MxN_nchw", "pooling_layer.cl" }, |
| 386 | { "pooling_layer_MxN_nhwc", "pooling_layer.cl" }, |
Gian Marco Iodice | 7333e1f | 2020-10-08 10:25:49 +0100 | [diff] [blame] | 387 | { "pooling_layer_2x2_nhwc", "pooling_layer.cl" }, |
Sheri Zhang | 801bbcb | 2020-08-03 20:11:56 +0100 | [diff] [blame] | 388 | { "pooling_layer_2_nchw_indices_fp32", "pooling_layer.cl" }, |
| 389 | { "pooling_layer_2_nchw_indices_fp16", "pooling_layer.cl" }, |
Michalis Spyrou | e74b201 | 2018-04-18 09:49:16 +0100 | [diff] [blame] | 390 | { "pooling_layer_MxN_quantized_nhwc", "pooling_layer_quantized.cl" }, |
| 391 | { "pooling_layer_MxN_quantized_nchw", "pooling_layer_quantized.cl" }, |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 392 | { "prior_box_layer_nchw", "prior_box_layer.cl" }, |
Sheri Zhang | b18252d | 2020-04-07 11:04:57 +0100 | [diff] [blame] | 393 | { "qlstm_layer_normalization", "qlstm_layer_normalization.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 394 | { "quantization_layer", "quantization_layer.cl" }, |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 395 | { "range", "range.cl" }, |
| 396 | { "range_quantized", "range.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 397 | { "reduction_operation_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7930db4 | 2018-11-22 17:36:28 +0000 | [diff] [blame] | 398 | { "reduction_operation_non_parallel_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 399 | { "reduction_operation_y", "reduction_operation.cl" }, |
| 400 | { "reduction_operation_z", "reduction_operation.cl" }, |
| 401 | { "reduction_operation_w", "reduction_operation.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 402 | { "remap_nearest_neighbour", "remap.cl" }, |
| 403 | { "remap_bilinear", "remap.cl" }, |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 404 | { "reorg_layer_nchw", "reorg_layer.cl" }, |
| 405 | { "reorg_layer_nhwc", "reorg_layer.cl" }, |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 406 | { "reshape_layer", "reshape_layer.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 407 | { "reshape_to_columns", "convolution_layer.cl" }, |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 408 | { "reverse", "reverse.cl" }, |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 409 | { "roi_align_layer", "roi_align_layer.cl" }, |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 410 | { "roi_align_layer_quantized", "roi_align_layer_quantized.cl" }, |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 411 | { "roi_pooling_layer", "roi_pooling_layer.cl" }, |
Michalis Spyrou | 46da23f | 2018-04-10 13:41:30 +0100 | [diff] [blame] | 412 | { "scale_nearest_neighbour_nchw", "scale.cl" }, |
| 413 | { "scale_nearest_neighbour_nhwc", "scale.cl" }, |
| 414 | { "scale_bilinear_nchw", "scale.cl" }, |
| 415 | { "scale_bilinear_nhwc", "scale.cl" }, |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 416 | { "scale_bilinear_quantized_nchw", "scale_quantized.cl" }, |
| 417 | { "scale_bilinear_quantized_nhwc", "scale_quantized.cl" }, |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 418 | { "select_same_rank", "select.cl" }, |
| 419 | { "select_different_rank_2", "select.cl" }, |
| 420 | { "select_different_rank_n", "select.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 421 | { "softmax_layer_norm", "softmax_layer.cl" }, |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 422 | { "softmax_layer_norm_quantized", "softmax_layer_quantized.cl" }, |
Giorgio Arena | 4402cb9 | 2018-02-15 13:37:40 +0000 | [diff] [blame] | 423 | { "softmax_layer_max_shift_exp_sum_quantized_serial", "softmax_layer_quantized.cl" }, |
| 424 | { "softmax_layer_max_shift_exp_sum_quantized_parallel", "softmax_layer_quantized.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 425 | { "softmax_layer_max_shift_exp_sum_serial", "softmax_layer.cl" }, |
Michalis Spyrou | 13a51e1 | 2018-09-18 13:09:30 +0100 | [diff] [blame] | 426 | { "space_to_batch_nchw", "space_to_batch.cl" }, |
| 427 | { "space_to_batch_static_nchw", "space_to_batch.cl" }, |
| 428 | { "space_to_batch_nhwc", "space_to_batch.cl" }, |
| 429 | { "space_to_batch_static_nhwc", "space_to_batch.cl" }, |
Michalis Spyrou | d69b3b2 | 2019-05-29 17:03:38 +0100 | [diff] [blame] | 430 | { "space_to_depth_nchw", "space_to_depth.cl" }, |
| 431 | { "space_to_depth_nhwc", "space_to_depth.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 432 | { "softmax_layer_max_shift_exp_sum_parallel", "softmax_layer.cl" }, |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 433 | { "stack_layer", "stack_layer.cl" }, |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 434 | { "strided_slice", "slice_ops.cl" }, |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 435 | { "tile", "tile.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 436 | { "transpose", "transpose.cl" }, |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 437 | { "upsample_layer_nchw", "upsample_layer.cl" }, |
| 438 | { "upsample_layer_nhwc", "upsample_layer.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 439 | { "winograd_filter_transform_2x2_3x3_nchw", "winograd_filter_transform.cl" }, |
| 440 | { "winograd_filter_transform_2x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 441 | { "winograd_filter_transform_1x2_1x3_nchw", "winograd_filter_transform.cl" }, |
| 442 | { "winograd_filter_transform_4x4_3x3_nchw", "winograd_filter_transform.cl" }, |
| 443 | { "winograd_filter_transform_4x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 444 | { "winograd_filter_transform_1x4_1x3_nchw", "winograd_filter_transform.cl" }, |
| 445 | { "winograd_filter_transform_4x4_5x5_nchw", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 446 | { "winograd_filter_transform_4x1_5x1_nchw", "winograd_filter_transform.cl" }, |
| 447 | { "winograd_filter_transform_1x4_1x5_nchw", "winograd_filter_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 448 | { "winograd_filter_transform_4x1_3x1_nhwc", "winograd_filter_transform.cl" }, |
| 449 | { "winograd_filter_transform_1x4_1x3_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 450 | { "winograd_filter_transform_4x4_3x3_nhwc", "winograd_filter_transform.cl" }, |
| 451 | { "winograd_filter_transform_4x4_5x5_nhwc", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 452 | { "winograd_filter_transform_4x1_5x1_nhwc", "winograd_filter_transform.cl" }, |
| 453 | { "winograd_filter_transform_1x4_1x5_nhwc", "winograd_filter_transform.cl" }, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 454 | { "winograd_filter_transform_2x2_7x7_nhwc", "winograd_filter_transform.cl" }, |
| 455 | { "winograd_filter_transform_2x1_7x1_nhwc", "winograd_filter_transform.cl" }, |
| 456 | { "winograd_filter_transform_1x2_1x7_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 457 | { "winograd_input_transform_2x2_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 458 | { "winograd_input_transform_2x2_3x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 459 | { "winograd_input_transform_2x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 460 | { "winograd_input_transform_2x1_3x1_stepz2_nchw", "winograd_input_transform.cl" }, |
| 461 | { "winograd_input_transform_1x2_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 462 | { "winograd_input_transform_1x2_1x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 463 | { "winograd_input_transform_4x4_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 464 | { "winograd_input_transform_4x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 465 | { "winograd_input_transform_1x4_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 466 | { "winograd_input_transform_4x4_5x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 467 | { "winograd_input_transform_4x1_5x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 468 | { "winograd_input_transform_1x4_1x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 469 | { "winograd_input_transform_4x1_3x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 470 | { "winograd_input_transform_1x4_1x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 471 | { "winograd_input_transform_4x4_3x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 472 | { "winograd_input_transform_4x4_5x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 473 | { "winograd_input_transform_4x1_5x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 474 | { "winograd_input_transform_1x4_1x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 475 | { "winograd_input_transform_2x2_7x7_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 476 | { "winograd_input_transform_2x1_7x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 477 | { "winograd_input_transform_1x2_1x7_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 478 | { "winograd_output_transform_2x2_3x3_nchw", "winograd_output_transform.cl" }, |
| 479 | { "winograd_output_transform_2x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 480 | { "winograd_output_transform_1x2_1x3_nchw", "winograd_output_transform.cl" }, |
| 481 | { "winograd_output_transform_4x4_3x3_nchw", "winograd_output_transform.cl" }, |
| 482 | { "winograd_output_transform_4x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 483 | { "winograd_output_transform_1x4_1x3_nchw", "winograd_output_transform.cl" }, |
| 484 | { "winograd_output_transform_4x4_5x5_nchw", "winograd_output_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 485 | { "winograd_output_transform_4x1_5x1_nchw", "winograd_output_transform.cl" }, |
| 486 | { "winograd_output_transform_1x4_1x5_nchw", "winograd_output_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 487 | { "winograd_output_transform_4x1_3x1_nhwc", "winograd_output_transform.cl" }, |
| 488 | { "winograd_output_transform_1x4_1x3_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 489 | { "winograd_output_transform_4x4_3x3_nhwc", "winograd_output_transform.cl" }, |
| 490 | { "winograd_output_transform_4x4_5x5_nhwc", "winograd_output_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 491 | { "winograd_output_transform_4x1_5x1_nhwc", "winograd_output_transform.cl" }, |
| 492 | { "winograd_output_transform_1x4_1x5_nhwc", "winograd_output_transform.cl" }, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 493 | { "winograd_output_transform_2x2_7x7_nhwc", "winograd_output_transform.cl" }, |
| 494 | { "winograd_output_transform_2x1_7x1_nhwc", "winograd_output_transform.cl" }, |
| 495 | { "winograd_output_transform_1x2_1x7_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 496 | { "yolo_layer_nchw", "yolo_layer.cl" }, |
| 497 | { "yolo_layer_nhwc", "yolo_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 498 | }; |
| 499 | |
| 500 | const std::map<std::string, std::string> CLKernelLibrary::_program_source_map = |
| 501 | { |
| 502 | #ifdef EMBEDDED_KERNELS |
| 503 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 504 | "activation_layer.cl", |
| 505 | #include "./cl_kernels/activation_layer.clembed" |
| 506 | }, |
| 507 | { |
Manuel Bottini | 30dbeef | 2019-06-26 16:23:03 +0100 | [diff] [blame] | 508 | "activation_layer_quant.cl", |
| 509 | #include "./cl_kernels/activation_layer_quant.clembed" |
Michel Iwaniec | 0063380 | 2017-10-12 14:14:15 +0100 | [diff] [blame] | 510 | }, |
| 511 | { |
Manuel Bottini | 7b9998d | 2019-10-21 17:59:07 +0100 | [diff] [blame] | 512 | "arg_min_max.cl", |
| 513 | #include "./cl_kernels/arg_min_max.clembed" |
| 514 | }, |
| 515 | { |
Michalis Spyrou | 6a8d3b6 | 2018-08-31 10:07:09 +0100 | [diff] [blame] | 516 | "batch_to_space.cl", |
| 517 | #include "./cl_kernels/batch_to_space.clembed" |
| 518 | }, |
| 519 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 520 | "bitwise_op.cl", |
| 521 | #include "./cl_kernels/bitwise_op.clembed" |
| 522 | }, |
| 523 | { |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 524 | "bounding_box_transform.cl", |
| 525 | #include "./cl_kernels/bounding_box_transform.clembed" |
| 526 | }, |
| 527 | { |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 528 | "bounding_box_transform_quantized.cl", |
| 529 | #include "./cl_kernels/bounding_box_transform_quantized.clembed" |
| 530 | }, |
| 531 | { |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 532 | "channel_shuffle.cl", |
| 533 | #include "./cl_kernels/channel_shuffle.clembed" |
| 534 | }, |
| 535 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 536 | "col2im.cl", |
| 537 | #include "./cl_kernels/col2im.clembed" |
| 538 | }, |
| 539 | { |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 540 | "comparisons.cl", |
| 541 | #include "./cl_kernels/comparisons.clembed" |
| 542 | }, |
| 543 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 544 | "concatenate.cl", |
| 545 | #include "./cl_kernels/concatenate.clembed" |
| 546 | }, |
| 547 | { |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 548 | "convert_fc_weights.cl", |
| 549 | #include "./cl_kernels/convert_fc_weights.clembed" |
Michalis Spyrou | 473cb01 | 2021-02-23 11:48:12 +0000 | [diff] [blame^] | 550 | }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 551 | { |
| 552 | "convolution_layer.cl", |
| 553 | #include "./cl_kernels/convolution_layer.clembed" |
| 554 | }, |
| 555 | { |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 556 | "copy_tensor.cl", |
| 557 | #include "./cl_kernels/copy_tensor.clembed" |
| 558 | }, |
| 559 | { |
George Wort | 894066d | 2019-02-15 15:12:52 +0000 | [diff] [blame] | 560 | "crop_tensor.cl", |
| 561 | #include "./cl_kernels/crop_tensor.clembed" |
| 562 | }, |
| 563 | { |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 564 | "upsample_layer.cl", |
| 565 | #include "./cl_kernels/upsample_layer.clembed" |
| 566 | }, |
| 567 | { |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 568 | "deconvolution_layer.cl", |
| 569 | #include "./cl_kernels/deconvolution_layer.clembed" |
| 570 | }, |
| 571 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 572 | "depth_convert.cl", |
| 573 | #include "./cl_kernels/depth_convert.clembed" |
| 574 | }, |
| 575 | { |
Michalis Spyrou | 649962c | 2019-05-22 11:11:55 +0100 | [diff] [blame] | 576 | "depth_to_space.cl", |
| 577 | #include "./cl_kernels/depth_to_space.clembed" |
| 578 | }, |
| 579 | { |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 580 | "depthwise_convolution.cl", |
| 581 | #include "./cl_kernels/depthwise_convolution.clembed" |
| 582 | }, |
| 583 | { |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 584 | "depthwise_convolution_quantized.cl", |
| 585 | #include "./cl_kernels/depthwise_convolution_quantized.clembed" |
| 586 | }, |
| 587 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 588 | "dequantization_layer.cl", |
| 589 | #include "./cl_kernels/dequantization_layer.clembed" |
| 590 | }, |
| 591 | { |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 592 | "direct_convolution1x1.cl", |
| 593 | #include "./cl_kernels/direct_convolution1x1.clembed" |
| 594 | }, |
| 595 | { |
| 596 | "direct_convolution3x3.cl", |
| 597 | #include "./cl_kernels/direct_convolution3x3.clembed" |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 598 | }, |
| 599 | { |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 600 | "direct_convolution5x5.cl", |
| 601 | #include "./cl_kernels/direct_convolution5x5.clembed" |
| 602 | }, |
| 603 | { |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 604 | "direct_convolution_quantized.cl", |
| 605 | #include "./cl_kernels/direct_convolution_quantized.clembed" |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 606 | }, |
| 607 | { |
Gian Marco Iodice | ff1fe3e | 2021-01-02 09:58:51 +0000 | [diff] [blame] | 608 | "direct_convolution.cl", |
| 609 | #include "./cl_kernels/direct_convolution.clembed" |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 610 | }, |
| 611 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 612 | "elementwise_operation.cl", |
| 613 | #include "./cl_kernels/elementwise_operation.clembed" |
| 614 | }, |
| 615 | { |
| 616 | "elementwise_operation_quantized.cl", |
| 617 | #include "./cl_kernels/elementwise_operation_quantized.clembed" |
| 618 | }, |
| 619 | { |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 620 | "elementwise_unary.cl", |
| 621 | #include "./cl_kernels/elementwise_unary.clembed" |
| 622 | }, |
| 623 | { |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 624 | "fft.cl", |
| 625 | #include "./cl_kernels/fft.clembed" |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 626 | }, |
| 627 | { |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 628 | "fft_digit_reverse.cl", |
| 629 | #include "./cl_kernels/fft_digit_reverse.clembed" |
| 630 | }, |
| 631 | { |
| 632 | "fft_scale.cl", |
| 633 | #include "./cl_kernels/fft_scale.clembed" |
| 634 | }, |
| 635 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 636 | "fill_border.cl", |
| 637 | #include "./cl_kernels/fill_border.clembed" |
| 638 | }, |
| 639 | { |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 640 | "floor.cl", |
| 641 | #include "./cl_kernels/floor.clembed" |
| 642 | }, |
| 643 | { |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 644 | "gather.cl", |
| 645 | #include "./cl_kernels/gather.clembed" |
| 646 | }, |
| 647 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 648 | "gemm.cl", |
| 649 | #include "./cl_kernels/gemm.clembed" |
| 650 | }, |
| 651 | { |
SiCong Li | 4abc9d1 | 2020-10-28 14:19:28 +0000 | [diff] [blame] | 652 | "gemm_v1.cl", |
| 653 | #include "./cl_kernels/gemm_v1.clembed" |
| 654 | }, |
| 655 | { |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 656 | "gemmlowp.cl", |
| 657 | #include "./cl_kernels/gemmlowp.clembed" |
| 658 | }, |
| 659 | { |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 660 | "gemv.cl", |
| 661 | #include "./cl_kernels/gemv.clembed" |
| 662 | }, |
| 663 | { |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 664 | "generate_proposals.cl", |
| 665 | #include "./cl_kernels/generate_proposals.clembed" |
| 666 | }, |
| 667 | { |
Michele Di Giorgio | 6b612f5 | 2019-09-05 12:30:22 +0100 | [diff] [blame] | 668 | "generate_proposals_quantized.cl", |
| 669 | #include "./cl_kernels/generate_proposals_quantized.clembed" |
| 670 | }, |
| 671 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 672 | "helpers.h", |
| 673 | #include "./cl_kernels/helpers.hembed" |
| 674 | }, |
| 675 | { |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 676 | "helpers_asymm.h", |
| 677 | #include "./cl_kernels/helpers_asymm.hembed" |
| 678 | }, |
| 679 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 680 | "im2col.cl", |
| 681 | #include "./cl_kernels/im2col.clembed" |
| 682 | }, |
| 683 | { |
Manuel Bottini | 79f88e6 | 2019-09-18 15:02:53 +0100 | [diff] [blame] | 684 | "instance_normalization.cl", |
| 685 | #include "./cl_kernels/instance_normalization.clembed" |
| 686 | }, |
| 687 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 688 | "l2_normalize.cl", |
| 689 | #include "./cl_kernels/l2_normalize.clembed" |
| 690 | }, |
| 691 | { |
Michele Di Giorgio | 5b48ad7 | 2019-06-04 18:43:35 +0100 | [diff] [blame] | 692 | "mean_stddev_normalization.cl", |
| 693 | #include "./cl_kernels/mean_stddev_normalization.clembed" |
| 694 | }, |
| 695 | { |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 696 | "memset.cl", |
| 697 | #include "./cl_kernels/memset.clembed" |
| 698 | }, |
| 699 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 700 | "minmax_layer.cl", |
| 701 | #include "./cl_kernels/minmax_layer.clembed" |
| 702 | }, |
| 703 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 704 | "nonmax.cl", |
| 705 | #include "./cl_kernels/nonmax.clembed" |
| 706 | }, |
| 707 | { |
| 708 | "normalization_layer.cl", |
| 709 | #include "./cl_kernels/normalization_layer.clembed" |
| 710 | }, |
| 711 | { |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 712 | "normalize_planar_yuv_layer.cl", |
| 713 | #include "./cl_kernels/normalize_planar_yuv_layer.clembed" |
| 714 | }, |
| 715 | { |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 716 | "normalize_planar_yuv_layer_quantized.cl", |
| 717 | #include "./cl_kernels/normalize_planar_yuv_layer_quantized.clembed" |
| 718 | }, |
| 719 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 720 | "batchnormalization_layer.cl", |
| 721 | #include "./cl_kernels/batchnormalization_layer.clembed" |
| 722 | }, |
| 723 | { |
Giorgio Arena | 205eed8 | 2019-08-14 10:13:50 +0100 | [diff] [blame] | 724 | "pad_layer.cl", |
| 725 | #include "./cl_kernels/pad_layer.clembed" |
| 726 | }, |
| 727 | { |
Michalis Spyrou | 5237e01 | 2018-01-17 09:40:27 +0000 | [diff] [blame] | 728 | "permute.cl", |
| 729 | #include "./cl_kernels/permute.clembed" |
| 730 | }, |
| 731 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 732 | "pixelwise_mul_float.cl", |
| 733 | #include "./cl_kernels/pixelwise_mul_float.clembed" |
| 734 | }, |
| 735 | { |
| 736 | "pixelwise_mul_int.cl", |
| 737 | #include "./cl_kernels/pixelwise_mul_int.clembed" |
| 738 | }, |
| 739 | { |
| 740 | "pooling_layer.cl", |
| 741 | #include "./cl_kernels/pooling_layer.clembed" |
| 742 | }, |
| 743 | { |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 744 | "pooling_layer_quantized.cl", |
| 745 | #include "./cl_kernels/pooling_layer_quantized.clembed" |
| 746 | }, |
| 747 | { |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 748 | "prior_box_layer.cl", |
| 749 | #include "./cl_kernels/prior_box_layer.clembed" |
| 750 | }, |
| 751 | { |
Sheri Zhang | b18252d | 2020-04-07 11:04:57 +0100 | [diff] [blame] | 752 | "qlstm_layer_normalization.cl", |
| 753 | #include "./cl_kernels/qlstm_layer_normalization.clembed" |
| 754 | }, |
| 755 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 756 | "quantization_layer.cl", |
| 757 | #include "./cl_kernels/quantization_layer.clembed" |
| 758 | }, |
| 759 | { |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 760 | "range.cl", |
| 761 | #include "./cl_kernels/range.clembed" |
| 762 | }, |
| 763 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 764 | "reduction_operation.cl", |
| 765 | #include "./cl_kernels/reduction_operation.clembed" |
| 766 | }, |
| 767 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 768 | "remap.cl", |
| 769 | #include "./cl_kernels/remap.clembed" |
| 770 | }, |
| 771 | { |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 772 | "reorg_layer.cl", |
| 773 | #include "./cl_kernels/reorg_layer.clembed" |
| 774 | }, |
| 775 | { |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 776 | "reshape_layer.cl", |
| 777 | #include "./cl_kernels/reshape_layer.clembed" |
| 778 | }, |
| 779 | { |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 780 | "reverse.cl", |
| 781 | #include "./cl_kernels/reverse.clembed" |
| 782 | }, |
| 783 | { |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 784 | "roi_align_layer.cl", |
| 785 | #include "./cl_kernels/roi_align_layer.clembed" |
| 786 | }, |
| 787 | { |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 788 | "roi_align_layer_quantized.cl", |
| 789 | #include "./cl_kernels/roi_align_layer_quantized.clembed" |
| 790 | }, |
| 791 | { |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 792 | "roi_pooling_layer.cl", |
| 793 | #include "./cl_kernels/roi_pooling_layer.clembed" |
| 794 | }, |
| 795 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 796 | "scale.cl", |
| 797 | #include "./cl_kernels/scale.clembed" |
| 798 | }, |
| 799 | { |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 800 | "scale_quantized.cl", |
| 801 | #include "./cl_kernels/scale_quantized.clembed" |
| 802 | }, |
| 803 | { |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 804 | "select.cl", |
| 805 | #include "./cl_kernels/select.clembed" |
| 806 | }, |
| 807 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 808 | "softmax_layer.cl", |
| 809 | #include "./cl_kernels/softmax_layer.clembed" |
| 810 | }, |
| 811 | { |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 812 | "softmax_layer_quantized.cl", |
| 813 | #include "./cl_kernels/softmax_layer_quantized.clembed" |
| 814 | }, |
| 815 | { |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 816 | "slice_ops.cl", |
| 817 | #include "./cl_kernels/slice_ops.clembed" |
Georgios Pinitas | 77589b5 | 2018-08-21 14:41:35 +0100 | [diff] [blame] | 818 | }, |
| 819 | { |
Michalis Spyrou | 16934a5 | 2018-08-21 18:03:58 +0100 | [diff] [blame] | 820 | "space_to_batch.cl", |
| 821 | #include "./cl_kernels/space_to_batch.clembed" |
| 822 | }, |
| 823 | { |
Michalis Spyrou | d69b3b2 | 2019-05-29 17:03:38 +0100 | [diff] [blame] | 824 | "space_to_depth.cl", |
| 825 | #include "./cl_kernels/space_to_depth.clembed" |
| 826 | }, |
| 827 | { |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 828 | "stack_layer.cl", |
| 829 | #include "./cl_kernels/stack_layer.clembed" |
| 830 | }, |
| 831 | { |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 832 | "tile.cl", |
| 833 | #include "./cl_kernels/tile.clembed" |
| 834 | }, |
| 835 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 836 | "transpose.cl", |
| 837 | #include "./cl_kernels/transpose.clembed" |
| 838 | }, |
| 839 | { |
| 840 | "types.h", |
| 841 | #include "./cl_kernels/types.hembed" |
| 842 | }, |
| 843 | { |
Gian Marco Iodice | 4d81d75 | 2020-07-14 15:05:31 +0100 | [diff] [blame] | 844 | "unpooling_layer.cl", |
| 845 | #include "./cl_kernels/unpooling_layer.clembed" |
| 846 | }, |
| 847 | { |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 848 | "winograd_filter_transform.cl", |
| 849 | #include "./cl_kernels/winograd_filter_transform.clembed" |
| 850 | }, |
| 851 | { |
| 852 | "winograd_input_transform.cl", |
| 853 | #include "./cl_kernels/winograd_input_transform.clembed" |
| 854 | }, |
| 855 | { |
| 856 | "winograd_output_transform.cl", |
| 857 | #include "./cl_kernels/winograd_output_transform.clembed" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 858 | }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 859 | { |
| 860 | "yolo_layer.cl", |
| 861 | #include "./cl_kernels/yolo_layer.clembed" |
| 862 | }, |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 863 | #endif /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 864 | }; |
| 865 | |
| 866 | CLKernelLibrary::CLKernelLibrary() |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 867 | : _compile_context(), _kernel_path(), _decompressed_source_map() |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 868 | { |
Anthony Barbier | ecb1c62 | 2018-04-17 11:45:10 +0100 | [diff] [blame] | 869 | opencl_is_available(); // Make sure the OpenCL symbols are initialised *before* the CLKernelLibrary is built |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 870 | } |
| 871 | |
| 872 | CLKernelLibrary &CLKernelLibrary::get() |
| 873 | { |
| 874 | static CLKernelLibrary _kernel_library; |
| 875 | return _kernel_library; |
| 876 | } |
| 877 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 878 | Kernel CLKernelLibrary::create_kernel(const std::string &kernel_name, const std::set<std::string> &build_options_set) const |
| 879 | { |
| 880 | const std::string program_name = get_program_name(kernel_name); |
| 881 | auto program = get_program(program_name); |
| 882 | |
| 883 | return _compile_context.create_kernel(kernel_name, program_name, program.first, _kernel_path, build_options_set, program.second); |
| 884 | } |
| 885 | |
| 886 | std::string CLKernelLibrary::get_program_name(const std::string &kernel_name) const |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 887 | { |
| 888 | // Find which program contains the kernel |
| 889 | auto kernel_program_it = _kernel_program_map.find(kernel_name); |
| 890 | |
| 891 | if(_kernel_program_map.end() == kernel_program_it) |
| 892 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 893 | ARM_COMPUTE_ERROR_VAR("Kernel %s not found in the CLKernelLibrary", kernel_name.c_str()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 894 | } |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 895 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 896 | const std::string program_name = kernel_program_it->second; |
Georgios Pinitas | df473ea | 2018-05-31 18:53:52 +0100 | [diff] [blame] | 897 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 898 | return program_name; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 899 | } |
| 900 | |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 901 | void CLKernelLibrary::init(std::string kernel_path, cl::Context context, cl::Device device) |
| 902 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 903 | _compile_context = CLCompileContext(context, device); |
| 904 | _kernel_path = kernel_path; |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 905 | } |
| 906 | |
| 907 | void CLKernelLibrary::set_kernel_path(const std::string &kernel_path) |
| 908 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 909 | _kernel_path = std::move(kernel_path); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | cl::Context &CLKernelLibrary::context() |
| 913 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 914 | return _compile_context.context(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 915 | } |
| 916 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 917 | const cl::Device &CLKernelLibrary::get_device() |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 918 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 919 | return _compile_context.get_device(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 920 | } |
| 921 | |
| 922 | void CLKernelLibrary::set_device(cl::Device device) |
| 923 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 924 | _compile_context.set_device(device); |
| 925 | } |
| 926 | |
| 927 | void CLKernelLibrary::set_context(cl::Context context) |
| 928 | { |
| 929 | _compile_context.set_context(context); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 930 | } |
| 931 | |
| 932 | std::string CLKernelLibrary::get_kernel_path() |
| 933 | { |
| 934 | return _kernel_path; |
| 935 | } |
| 936 | |
| 937 | void CLKernelLibrary::clear_programs_cache() |
| 938 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 939 | _compile_context.clear_programs_cache(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 940 | } |
| 941 | |
| 942 | const std::map<std::string, cl::Program> &CLKernelLibrary::get_built_programs() const |
| 943 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 944 | return _compile_context.get_built_programs(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 945 | } |
| 946 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 947 | void CLKernelLibrary::add_built_program(const std::string &built_program_name, const cl::Program &program) |
Anthony Barbier | 7da55aa | 2018-04-13 16:58:43 +0100 | [diff] [blame] | 948 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 949 | _compile_context.add_built_program(built_program_name, program); |
Anthony Barbier | 7da55aa | 2018-04-13 16:58:43 +0100 | [diff] [blame] | 950 | } |
| 951 | |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 952 | bool CLKernelLibrary::fp16_supported() const |
| 953 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 954 | return _compile_context.fp16_supported(); |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 955 | } |
| 956 | |
Vidhya Sudhan Loganathan | 76c8564 | 2018-05-25 13:53:02 +0100 | [diff] [blame] | 957 | bool CLKernelLibrary::int64_base_atomics_supported() const |
| 958 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 959 | return _compile_context.int64_base_atomics_supported(); |
Vidhya Sudhan Loganathan | 76c8564 | 2018-05-25 13:53:02 +0100 | [diff] [blame] | 960 | } |
| 961 | |
Manuel Bottini | be9f9f9 | 2021-01-25 15:07:17 +0000 | [diff] [blame] | 962 | bool CLKernelLibrary::is_wbsm_supported() |
| 963 | { |
| 964 | return _compile_context.is_wbsm_supported(); |
| 965 | } |
| 966 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 967 | std::pair<std::string, bool> CLKernelLibrary::get_program(const std::string &program_name) const |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 968 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 969 | #ifdef EMBEDDED_KERNELS |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 970 | #ifdef ARM_COMPUTE_COMPRESSED_KERNELS |
| 971 | const auto inflatted_program_source_it = _decompressed_source_map.find(program_name); |
| 972 | if(inflatted_program_source_it != _decompressed_source_map.end()) |
| 973 | { |
| 974 | return std::make_pair(inflatted_program_source_it->second, false); |
| 975 | } |
| 976 | #endif /* ARM_COMPUTE_COMPRESSED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 977 | |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 978 | const auto program_source_it = _program_source_map.find(program_name); |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 979 | if(program_source_it == _program_source_map.end()) |
| 980 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 981 | ARM_COMPUTE_ERROR_VAR("Embedded program for %s does not exist.", program_name.c_str()); |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 982 | } |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 983 | std::string program_source = program_source_it->second; |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 984 | |
Georgios Pinitas | ea85727 | 2021-01-22 05:47:37 +0000 | [diff] [blame] | 985 | #ifdef ARM_COMPUTE_COMPRESSED_KERNELS |
| 986 | std::string decompressed_program_source = decompress_zlib(decode_base64(program_source_it->second)); |
| 987 | ARM_COMPUTE_ERROR_ON_MSG(decompressed_program_source.empty(), "Cannot de-compress requested program"); |
| 988 | _decompressed_source_map.insert(std::make_pair(program_name, decompressed_program_source)); |
| 989 | program_source = std::move(decompressed_program_source); |
| 990 | #endif /* ARM_COMPUTE_COMPRESSED_KERNELS */ |
| 991 | |
| 992 | return std::make_pair(program_source, false); |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 993 | #else /* EMBEDDED_KERNELS */ |
| 994 | // Check for binary |
| 995 | std::string source_name = _kernel_path + program_name; |
| 996 | std::string binary_name = source_name + "bin"; |
| 997 | std::string program_source{}; |
| 998 | bool is_binary = false; |
| 999 | |
| 1000 | if(std::ifstream(binary_name).is_open()) |
| 1001 | { |
| 1002 | program_source = read_file(binary_name, true); |
| 1003 | is_binary = true; |
| 1004 | } |
| 1005 | else if(std::ifstream(source_name).is_open()) |
| 1006 | { |
| 1007 | program_source = read_file(source_name, false); |
| 1008 | } |
| 1009 | else |
| 1010 | { |
| 1011 | ARM_COMPUTE_ERROR_VAR("Kernel file %s does not exist.", source_name.c_str()); |
| 1012 | } |
| 1013 | |
| 1014 | return std::make_pair(program_source, is_binary); |
| 1015 | #endif /* EMBEDDED_KERNELS */ |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1016 | } |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1017 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1018 | size_t CLKernelLibrary::max_local_workgroup_size(const cl::Kernel &kernel) const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1019 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1020 | return _compile_context.max_local_workgroup_size(kernel); |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1021 | } |
| 1022 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1023 | cl::NDRange CLKernelLibrary::default_ndrange() const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1024 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1025 | return _compile_context.default_ndrange(); |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1026 | } |
Anthony Barbier | 847864d | 2018-03-07 11:35:53 +0000 | [diff] [blame] | 1027 | |
| 1028 | std::string CLKernelLibrary::get_device_version() |
| 1029 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1030 | return _compile_context.get_device_version(); |
Anthony Barbier | 847864d | 2018-03-07 11:35:53 +0000 | [diff] [blame] | 1031 | } |
Giorgio Arena | 5d42b46 | 2019-07-26 15:54:20 +0100 | [diff] [blame] | 1032 | |
| 1033 | cl_uint CLKernelLibrary::get_num_compute_units() |
| 1034 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1035 | return _compile_context.get_num_compute_units(); |
| 1036 | } |
| 1037 | |
| 1038 | CLCompileContext &CLKernelLibrary::get_compile_context() |
| 1039 | { |
| 1040 | return _compile_context; |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 1041 | } |