Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 2 | * Copyright (c) 2016-2019 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" |
| 29 | |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 30 | #include <algorithm> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 31 | #include <fstream> |
| 32 | #include <iostream> |
| 33 | #include <utility> |
| 34 | #include <vector> |
| 35 | |
| 36 | using namespace arm_compute; |
| 37 | |
Georgios Pinitas | 388d3ec | 2017-11-02 12:17:56 +0000 | [diff] [blame] | 38 | CLBuildOptions::CLBuildOptions() |
| 39 | : _build_opts() |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | void CLBuildOptions::add_option(std::string option) |
| 44 | { |
| 45 | _build_opts.emplace(std::move(option)); |
| 46 | } |
| 47 | |
| 48 | void CLBuildOptions::add_option_if(bool cond, std::string option) |
| 49 | { |
| 50 | if(cond) |
| 51 | { |
| 52 | add_option(std::move(option)); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | void CLBuildOptions::add_option_if_else(bool cond, std::string option_true, std::string option_false) |
| 57 | { |
| 58 | (cond) ? add_option(std::move(option_true)) : add_option(std::move(option_false)); |
| 59 | } |
| 60 | |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 61 | void CLBuildOptions::add_options(const StringSet &options) |
| 62 | { |
| 63 | _build_opts.insert(options.begin(), options.end()); |
| 64 | } |
| 65 | |
| 66 | void CLBuildOptions::add_options_if(bool cond, const StringSet &options) |
| 67 | { |
| 68 | if(cond) |
| 69 | { |
| 70 | add_options(options); |
| 71 | } |
| 72 | } |
| 73 | |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 74 | const CLBuildOptions::StringSet &CLBuildOptions::options() const |
Georgios Pinitas | 388d3ec | 2017-11-02 12:17:56 +0000 | [diff] [blame] | 75 | { |
| 76 | return _build_opts; |
| 77 | } |
| 78 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 79 | Program::Program() |
| 80 | : _context(), _device(), _is_binary(false), _name(), _source(), _binary() |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | Program::Program(cl::Context context, std::string name, std::string source) |
| 85 | : _context(std::move(context)), _device(), _is_binary(false), _name(std::move(name)), _source(std::move(source)), _binary() |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | Program::Program(cl::Context context, cl::Device device, std::string name, std::vector<unsigned char> binary) |
| 90 | : _context(std::move(context)), _device(std::move(device)), _is_binary(true), _name(std::move(name)), _source(), _binary(std::move(binary)) |
| 91 | { |
| 92 | } |
| 93 | |
| 94 | Program::operator cl::Program() const |
| 95 | { |
| 96 | if(_is_binary) |
| 97 | { |
| 98 | return cl::Program(_context, { _device }, { _binary }); |
| 99 | } |
| 100 | else |
| 101 | { |
| 102 | return cl::Program(_context, _source, false); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | bool Program::build(const cl::Program &program, const std::string &build_options) |
| 107 | { |
| 108 | try |
| 109 | { |
| 110 | return program.build(build_options.c_str()) == CL_SUCCESS; |
| 111 | } |
| 112 | catch(const cl::Error &e) |
| 113 | { |
| 114 | cl_int err = CL_SUCCESS; |
| 115 | const auto build_info = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(&err); |
| 116 | |
| 117 | for(auto &pair : build_info) |
| 118 | { |
| 119 | std::cerr << pair.second << std::endl; |
| 120 | } |
| 121 | |
| 122 | return false; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | cl::Program Program::build(const std::string &build_options) const |
| 127 | { |
| 128 | cl::Program cl_program = static_cast<cl::Program>(*this); |
| 129 | build(cl_program, build_options); |
| 130 | return cl_program; |
| 131 | } |
| 132 | |
| 133 | Kernel::Kernel() |
| 134 | : _name(), _kernel() |
| 135 | { |
| 136 | } |
| 137 | |
| 138 | Kernel::Kernel(std::string name, const cl::Program &program) |
| 139 | : _name(std::move(name)), |
| 140 | _kernel(cl::Kernel(program, _name.c_str())) |
| 141 | { |
| 142 | } |
| 143 | |
| 144 | const std::map<std::string, std::string> CLKernelLibrary::_kernel_program_map = |
| 145 | { |
| 146 | { "absdiff", "absdiff.cl" }, |
| 147 | { "accumulate", "accumulate.cl" }, |
| 148 | { "accumulate_squared", "accumulate.cl" }, |
| 149 | { "accumulate_weighted", "accumulate.cl" }, |
| 150 | { "activation_layer", "activation_layer.cl" }, |
Manuel Bottini | 30dbeef | 2019-06-26 16:23:03 +0100 | [diff] [blame] | 151 | { "activation_layer_quant", "activation_layer_quant.cl" }, |
| 152 | { "activation_layer_quant_f32", "activation_layer_quant.cl" }, |
Manuel Bottini | 7b9998d | 2019-10-21 17:59:07 +0100 | [diff] [blame^] | 153 | { "arg_min_max_x", "arg_min_max.cl" }, |
| 154 | { "arg_min_max_y", "arg_min_max.cl" }, |
| 155 | { "arg_min_max_z", "arg_min_max.cl" }, |
| 156 | { "arg_min_max_w", "arg_min_max.cl" }, |
Michalis Spyrou | f1addb6 | 2018-09-11 11:16:47 +0100 | [diff] [blame] | 157 | { "batch_to_space_nchw", "batch_to_space.cl" }, |
| 158 | { "batch_to_space_static_nchw", "batch_to_space.cl" }, |
| 159 | { "batch_to_space_nhwc", "batch_to_space.cl" }, |
| 160 | { "batch_to_space_static_nhwc", "batch_to_space.cl" }, |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 161 | { "batchnormalization_layer_nchw", "batchnormalization_layer.cl" }, |
| 162 | { "batchnormalization_layer_nhwc", "batchnormalization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 163 | { "bitwise_or", "bitwise_op.cl" }, |
| 164 | { "bitwise_and", "bitwise_op.cl" }, |
| 165 | { "bitwise_xor", "bitwise_op.cl" }, |
| 166 | { "bitwise_not", "bitwise_op.cl" }, |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 167 | { "bounding_box_transform", "bounding_box_transform.cl" }, |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 168 | { "bounding_box_transform_quantized", "bounding_box_transform_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 169 | { "channel_combine_NV", "channel_combine.cl" }, |
| 170 | { "channel_combine_RGB888", "channel_combine.cl" }, |
| 171 | { "channel_combine_RGBA8888", "channel_combine.cl" }, |
| 172 | { "channel_combine_UYVY422", "channel_combine.cl" }, |
| 173 | { "channel_combine_YUYV422", "channel_combine.cl" }, |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 174 | { "channel_shuffle_nchw", "channel_shuffle.cl" }, |
Gian Marco Iodice | 8bab0ee | 2018-09-13 11:51:56 +0100 | [diff] [blame] | 175 | { "channel_shuffle_nhwc", "channel_shuffle.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 176 | { "channel_extract_NV12", "channel_extract.cl" }, |
| 177 | { "channel_extract_NV21", "channel_extract.cl" }, |
| 178 | { "channel_extract_RGB888", "channel_extract.cl" }, |
| 179 | { "channel_extract_RGBA8888", "channel_extract.cl" }, |
| 180 | { "channel_extract_UYVY422", "channel_extract.cl" }, |
| 181 | { "channel_extract_YUYV422", "channel_extract.cl" }, |
| 182 | { "combine_gradients_L1", "canny.cl" }, |
| 183 | { "combine_gradients_L2", "canny.cl" }, |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 184 | { "compare_equal", "comparisons.cl" }, |
| 185 | { "compare_equal_quantized", "comparisons.cl" }, |
| 186 | { "compare_notequal", "comparisons.cl" }, |
| 187 | { "compare_notequal_quantized", "comparisons.cl" }, |
| 188 | { "compare_greater", "comparisons.cl" }, |
| 189 | { "compare_greater_quantized", "comparisons.cl" }, |
| 190 | { "compare_greaterequal", "comparisons.cl" }, |
| 191 | { "compare_greaterequal_quantized", "comparisons.cl" }, |
| 192 | { "compare_less", "comparisons.cl" }, |
| 193 | { "compare_less_quantized", "comparisons.cl" }, |
| 194 | { "compare_lessequal", "comparisons.cl" }, |
| 195 | { "compare_lessequal_quantized", "comparisons.cl" }, |
Vidhya Sudhan Loganathan | 338595b | 2019-06-28 14:09:53 +0100 | [diff] [blame] | 196 | { "concatenate", "concatenate.cl" }, |
Michalis Spyrou | 55b3d12 | 2018-05-09 09:59:23 +0100 | [diff] [blame] | 197 | { "concatenate_width", "concatenate.cl" }, |
Pablo Tello | 6a14adb | 2019-03-05 17:33:08 +0000 | [diff] [blame] | 198 | { "concatenate_height", "concatenate.cl" }, |
Michele Di Giorgio | 27400b9 | 2018-11-01 13:44:05 +0000 | [diff] [blame] | 199 | { "concatenate_width_x2", "concatenate.cl" }, |
| 200 | { "concatenate_width_x4", "concatenate.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 201 | { "convolution_rectangle", "convolution_rectangle.cl" }, |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 202 | { "col2im", "col2im.cl" }, |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 203 | { "convert_depth_down", "depth_convert.cl" }, |
| 204 | { "convert_depth_up", "depth_convert.cl" }, |
| 205 | { "convert_fc_weights", "convert_fc_weights.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 206 | { "convolution3x3_static", "convolution3x3.cl" }, |
| 207 | { "convolution5x5_static", "convolution5x5.cl" }, |
| 208 | { "convolution7x7_static", "convolution7x7.cl" }, |
| 209 | { "convolution9x9_static", "convolution9x9.cl" }, |
| 210 | { "convolution_separable1x5_static", "convolution5x5.cl" }, |
| 211 | { "convolution_separable5x1_static", "convolution5x5.cl" }, |
| 212 | { "convolution_separable1x7_static", "convolution7x7.cl" }, |
| 213 | { "convolution_separable7x1_static", "convolution7x7.cl" }, |
| 214 | { "convolution_separable1x9_static", "convolution9x9.cl" }, |
| 215 | { "convolution_separable9x1_static", "convolution9x9.cl" }, |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 216 | { "copy_tensor", "copy_tensor.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 217 | { "copy_pad_tensor", "copy_tensor.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 218 | { "copy_plane", "channel_extract.cl" }, |
| 219 | { "copy_planes_3p", "channel_combine.cl" }, |
| 220 | { "copy_to_keypoint", "fast_corners.cl" }, |
George Wort | 894066d | 2019-02-15 15:12:52 +0000 | [diff] [blame] | 221 | { "crop_tensor", "crop_tensor.cl" }, |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 222 | { "deconvolution_reshape", "deconvolution_layer.cl" }, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 223 | { "deconvolution_upsample", "deconvolution_layer.cl" }, |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 224 | { "depthwise_convolution_3x3", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 225 | { "depthwise_convolution_3x3_f16", "depthwise_convolution.cl" }, |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 226 | { "depthwise_convolution_3x3_nhwc", "depthwise_convolution.cl" }, |
| 227 | { "depthwise_convolution_3x3_nhwc_stride1", "depthwise_convolution.cl" }, |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 228 | { "dwc_MxN_native_fp_nhwc", "depthwise_convolution.cl" }, |
Michele Di Giorgio | a046e16 | 2019-10-08 09:36:26 +0100 | [diff] [blame] | 229 | { "dwc_MxN_native_quantized8_nhwc", "depthwise_convolution_quantized.cl" }, |
Michele Di Giorgio | df4cf57 | 2019-10-09 15:32:39 +0100 | [diff] [blame] | 230 | { "dwc_3x3_native_quantized8_nchw", "depthwise_convolution_quantized.cl" }, |
| 231 | { "dwc_3x3_native_quantized8_dot8_nchw", "depthwise_convolution_quantized.cl" }, |
| 232 | { "dwc_3x3_reshaped_quantized8_nhwc", "depthwise_convolution_quantized.cl" }, |
| 233 | { "dwc_3x3_reshaped_quantized8_stride1_nhwc", "depthwise_convolution_quantized.cl" }, |
| 234 | { "dwc_3x3_reshaped_quantized8_dot8_stride1_nhwc", "depthwise_convolution_quantized.cl" }, |
Michalis Spyrou | 649962c | 2019-05-22 11:11:55 +0100 | [diff] [blame] | 235 | { "depth_to_space_nchw", "depth_to_space.cl" }, |
| 236 | { "depth_to_space_nhwc", "depth_to_space.cl" }, |
Michele Di Giorgio | 3ebef32 | 2018-02-21 10:02:58 +0000 | [diff] [blame] | 237 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f16", "depthwise_convolution.cl" }, |
| 238 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f16", "depthwise_convolution.cl" }, |
| 239 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f32", "depthwise_convolution.cl" }, |
| 240 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f32", "depthwise_convolution.cl" }, |
giuros01 | 6d10996 | 2019-01-07 17:47:19 +0000 | [diff] [blame] | 241 | { "depthwise_convolution_reshape_weights", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 242 | { "dequantization_layer", "dequantization_layer.cl" }, |
Michalis Spyrou | 3f632f3 | 2019-08-22 16:52:00 +0100 | [diff] [blame] | 243 | { "dequantization_layer_per_channel_nhwc", "dequantization_layer.cl" }, |
| 244 | { "dequantization_layer_per_channel_nchw", "dequantization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 245 | { "derivative", "derivative.cl" }, |
| 246 | { "dilate", "dilate.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 247 | { "direct_convolution1x1", "direct_convolution1x1.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 248 | { "direct_convolution1x1_nhwc", "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" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 251 | { "direct_convolution3x3_nhwc", "direct_convolution3x3.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 252 | { "direct_convolution3x3_f32_bifrost", "direct_convolution3x3.cl" }, |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 253 | { "direct_convolution5x5", "direct_convolution5x5.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 254 | { "direct_convolution5x5_nhwc", "direct_convolution5x5.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 255 | { "direct_convolution5x5_f32_bifrost", "direct_convolution5x5.cl" }, |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 256 | { "direct_convolution_quantized", "direct_convolution_quantized.cl" }, |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 257 | { "direct_convolution9x9_nhwc", "direct_convolution9x9.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 258 | { "elementwise_operation_ADD", "elementwise_operation.cl" }, |
| 259 | { "elementwise_operation_SUB", "elementwise_operation.cl" }, |
| 260 | { "elementwise_operation_MAX", "elementwise_operation.cl" }, |
| 261 | { "elementwise_operation_MIN", "elementwise_operation.cl" }, |
| 262 | { "elementwise_operation_DIV", "elementwise_operation.cl" }, |
| 263 | { "elementwise_operation_SQUARED_DIFF", "elementwise_operation.cl" }, |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 264 | { "elementwise_operation_POWER", "elementwise_operation.cl" }, |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 265 | { "elementwise_operation_PRELU", "elementwise_operation.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 266 | { "elementwise_operation_ADD_quantized", "elementwise_operation_quantized.cl" }, |
| 267 | { "elementwise_operation_SUB_quantized", "elementwise_operation_quantized.cl" }, |
| 268 | { "elementwise_operation_MAX_quantized", "elementwise_operation_quantized.cl" }, |
| 269 | { "elementwise_operation_MIN_quantized", "elementwise_operation_quantized.cl" }, |
| 270 | { "elementwise_operation_DIV_quantized", "elementwise_operation_quantized.cl" }, |
| 271 | { "elementwise_operation_SQUARED_DIFF_quantized", "elementwise_operation_quantized.cl" }, |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 272 | { "elementwise_operation_PRELU_quantized", "elementwise_operation_quantized.cl" }, |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 273 | { "elementwise_unary", "elementwise_unary.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 274 | { "erode", "erode.cl" }, |
| 275 | { "fast_corners", "fast_corners.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 276 | { "fft_digit_reverse_axis_0", "fft_digit_reverse.cl" }, |
| 277 | { "fft_digit_reverse_axis_1", "fft_digit_reverse.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 278 | { "fft_radix_2_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 279 | { "fft_radix_2_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 280 | { "fft_radix_2_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 281 | { "fft_radix_2_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 282 | { "fft_radix_3_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 283 | { "fft_radix_3_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 284 | { "fft_radix_3_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 285 | { "fft_radix_3_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 286 | { "fft_radix_4_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 287 | { "fft_radix_4_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 288 | { "fft_radix_4_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 289 | { "fft_radix_4_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 290 | { "fft_radix_5_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 291 | { "fft_radix_5_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 292 | { "fft_radix_5_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 293 | { "fft_radix_5_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 294 | { "fft_radix_7_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 295 | { "fft_radix_7_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 296 | { "fft_radix_7_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 297 | { "fft_radix_7_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 298 | { "fft_radix_8_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 299 | { "fft_radix_8_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 300 | { "fft_radix_8_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 301 | { "fft_radix_8_axis_1", "fft.cl" }, |
| 302 | { "fft_scale_conj", "fft_scale.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 303 | { "fill_image_borders_constant", "fill_border.cl" }, |
| 304 | { "fill_image_borders_replicate", "fill_border.cl" }, |
| 305 | { "finalize", "optical_flow_pyramid_lk.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 306 | { "flatten", "flatten.cl" }, |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 307 | { "floor_layer", "floor.cl" }, |
Manuel Bottini | 2732cca | 2019-05-28 11:44:41 +0100 | [diff] [blame] | 308 | { "fuse_batchnormalization_layer", "batchnormalization_layer.cl" }, |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 309 | { "gather", "gather.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 310 | { "gaussian1x5_sub_x", "gaussian_pyramid.cl" }, |
| 311 | { "gaussian5x1_sub_y", "gaussian_pyramid.cl" }, |
Gian Marco Iodice | 578ab61 | 2017-06-23 09:34:33 +0100 | [diff] [blame] | 312 | { "gemm_accumulate_biases", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 313 | { "gemm_ma_f16", "gemm.cl" }, |
| 314 | { "gemm_ma_f32", "gemm.cl" }, |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 315 | { "gemm_mv", "gemv.cl" }, |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 316 | { "gemm_mv_quantized", "gemv.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 317 | { "gemm_mm_interleaved_transposed_f16", "gemm.cl" }, |
Vidhya Sudhan Loganathan | 38d93bd | 2018-11-20 15:38:13 +0000 | [diff] [blame] | 318 | { "gemm_mm_interleaved_transposed_f16_acc32", "gemm.cl" }, |
Gian Marco Iodice | bb36a8e | 2018-04-19 12:05:08 +0100 | [diff] [blame] | 319 | { "gemm_mm_interleaved_transposed_f16_bifrost", "gemm.cl" }, |
| 320 | { "gemm_mm_interleaved_transposed_f32", "gemm.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 321 | { "gemm_mm_interleaved_transposed_f32_bifrost", "gemm.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 322 | { "gemm_mm_floating_point", "gemm.cl" }, |
Gian Marco Iodice | fd68311 | 2018-04-17 09:52:44 +0100 | [diff] [blame] | 323 | { "gemm_mm_floating_point_f16_bifrost", "gemm.cl" }, |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 324 | { "gemm_mm_floating_point_f16_bifrost_acc32", "gemm.cl" }, |
Anton Lokhmotov | 3e80c7f | 2017-11-20 11:02:10 +0000 | [diff] [blame] | 325 | { "gemm_mm_floating_point_f32_bifrost", "gemm.cl" }, |
| 326 | { "gemm_mm_floating_point_f32_bifrost_1000", "gemm.cl" }, |
giuros01 | b3204e7 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 327 | { "gemm_mm_native", "gemm.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 328 | { "gemm_mm_reshaped_lhs_nt_rhs_t", "gemm.cl" }, |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 329 | { "gemm_mm_reshaped_lhs_t_rhs_nt", "gemm.cl" }, |
Gian Marco Iodice | ba5e096 | 2019-03-11 12:17:44 +0000 | [diff] [blame] | 330 | { "gemm_mm_reshaped_only_rhs_nt", "gemm.cl" }, |
Gian Marco Iodice | adc5395 | 2019-02-15 11:10:31 +0000 | [diff] [blame] | 331 | { "gemm_mm_reshaped_only_rhs_t", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 332 | { "gemm_lc_vm_f32", "gemm.cl" }, |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 333 | { "gemm_reshape_lhs_matrix_nt", "gemm.cl" }, |
Gian Marco Iodice | 08ddd7b | 2018-12-19 10:01:18 +0000 | [diff] [blame] | 334 | { "gemm_reshape_lhs_matrix_t", "gemm.cl" }, |
Gian Marco Iodice | 3b0a265 | 2018-12-07 11:18:09 +0000 | [diff] [blame] | 335 | { "gemm_reshape_rhs_matrix_nt", "gemm.cl" }, |
| 336 | { "gemm_reshape_rhs_matrix_t", "gemm.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 337 | { "gemmlowp_matrix_a_reduction", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 338 | { "gemmlowp_matrix_a_reduction_dot8", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 339 | { "gemmlowp_matrix_b_reduction", "gemmlowp.cl" }, |
Gian Marco | 7b4d547 | 2018-01-10 15:56:30 +0000 | [diff] [blame] | 340 | { "gemmlowp_mm_midgard", "gemmlowp.cl" }, |
Gian Marco Iodice | e751062 | 2019-06-03 17:28:17 +0100 | [diff] [blame] | 341 | { "gemmlowp_mm_native", "gemmlowp.cl" }, |
Gian Marco Iodice | db63b9c | 2019-01-17 09:47:04 +0000 | [diff] [blame] | 342 | { "gemmlowp_mm_reshaped_lhs_nt_rhs_t", "gemmlowp.cl" }, |
Gian Marco Iodice | 62251f7 | 2019-03-11 16:07:12 +0000 | [diff] [blame] | 343 | { "gemmlowp_mm_reshaped_only_rhs_t", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 344 | { "gemmlowp_offset_contribution", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 345 | { "gemmlowp_offset_contribution_quantize_down", "gemmlowp.cl" }, |
| 346 | { "gemmlowp_offset_contribution_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 347 | { "gemmlowp_output_stage_quantize_down", "gemmlowp.cl" }, |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 348 | { "gemmlowp_output_stage_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Manuel Bottini | 9c9b70b | 2019-07-01 17:35:56 +0100 | [diff] [blame] | 349 | { "gemmlowp_output_stage_quantize_down_fixedpoint_qsymm16", "gemmlowp.cl" }, |
Georgios Pinitas | 51e53a3 | 2018-10-22 13:49:08 +0100 | [diff] [blame] | 350 | { "gemmlowp_output_stage_quantize_down_float", "gemmlowp.cl" }, |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 351 | { "generate_proposals_compute_all_anchors", "generate_proposals.cl" }, |
Michele Di Giorgio | 6b612f5 | 2019-09-05 12:30:22 +0100 | [diff] [blame] | 352 | { "generate_proposals_compute_all_anchors_quantized", "generate_proposals_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 353 | { "harris_score_3x3", "harris_corners.cl" }, |
| 354 | { "harris_score_5x5", "harris_corners.cl" }, |
| 355 | { "harris_score_7x7", "harris_corners.cl" }, |
| 356 | { "hist_border_kernel", "histogram.cl" }, |
| 357 | { "hist_border_kernel_fixed", "histogram.cl" }, |
| 358 | { "hist_local_kernel", "histogram.cl" }, |
| 359 | { "hist_local_kernel_fixed", "histogram.cl" }, |
| 360 | { "hog_block_normalization", "hog.cl" }, |
| 361 | { "hog_detector", "hog.cl" }, |
| 362 | { "hog_orientation_binning", "hog.cl" }, |
| 363 | { "hysteresis", "canny.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 364 | { "im2col1x1_stridex1_nchw", "im2col.cl" }, |
| 365 | { "im2col3x3_nchw", "im2col.cl" }, |
| 366 | { "im2col5x5_nchw", "im2col.cl" }, |
| 367 | { "im2col11x11_padx0_pady0_nchw", "im2col.cl" }, |
| 368 | { "im2col_generic_nchw", "im2col.cl" }, |
| 369 | { "im2col_generic_padx0_pady0_nchw", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 370 | { "im2col3x3_nhwc", "im2col.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 371 | { "im2col9x9_nhwc", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 372 | { "im2col_generic_nhwc", "im2col.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 373 | { "init_level", "optical_flow_pyramid_lk.cl" }, |
| 374 | { "init_level_max", "optical_flow_pyramid_lk.cl" }, |
| 375 | { "init_level_max_initial_estimate", "optical_flow_pyramid_lk.cl" }, |
Manuel Bottini | 79f88e6 | 2019-09-18 15:02:53 +0100 | [diff] [blame] | 376 | { "instance_normalization", "instance_normalization.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 377 | { "integral_horizontal", "integral_image.cl" }, |
| 378 | { "integral_vertical", "integral_image.cl" }, |
| 379 | { "IYUV_to_NV12_bt709", "color_convert.cl" }, |
| 380 | { "IYUV_to_RGB888_bt709", "color_convert.cl" }, |
| 381 | { "IYUV_to_RGBA8888_bt709", "color_convert.cl" }, |
| 382 | { "IYUV_to_YUV444_bt709", "color_convert.cl" }, |
Michalis Spyrou | 5538d34 | 2018-11-14 08:10:13 +0000 | [diff] [blame] | 383 | { "l2_normalize_x", "l2_normalize.cl" }, |
| 384 | { "l2_normalize_y", "l2_normalize.cl" }, |
| 385 | { "l2_normalize_z", "l2_normalize.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 386 | { "lktracker_stage0", "optical_flow_pyramid_lk.cl" }, |
| 387 | { "lktracker_stage1", "optical_flow_pyramid_lk.cl" }, |
| 388 | { "magnitude_phase", "magnitude_phase.cl" }, |
| 389 | { "mean_stddev_accumulate", "mean_stddev.cl" }, |
Michele Di Giorgio | 5b48ad7 | 2019-06-04 18:43:35 +0100 | [diff] [blame] | 390 | { "mean_stddev_normalization", "mean_stddev_normalization.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 391 | { "memset", "memset.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 392 | { "minmax", "minmaxloc.cl" }, |
| 393 | { "minmax_border", "minmaxloc.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 394 | { "minmax_layer", "minmax_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 395 | { "minmaxloc", "minmaxloc.cl" }, |
| 396 | { "non_linear_filter_box3x3", "non_linear_filter3x3.cl" }, |
| 397 | { "non_linear_filter_cross3x3", "non_linear_filter3x3.cl" }, |
| 398 | { "non_linear_filter_disk3x3", "non_linear_filter3x3.cl" }, |
| 399 | { "non_linear_filter_box5x5", "non_linear_filter5x5.cl" }, |
| 400 | { "non_linear_filter_cross5x5", "non_linear_filter5x5.cl" }, |
| 401 | { "non_linear_filter_disk5x5", "non_linear_filter5x5.cl" }, |
| 402 | { "non_max_suppression", "nonmax.cl" }, |
| 403 | { "normalization_layer_cross_map", "normalization_layer.cl" }, |
Michele Di Giorgio | 9d3a831 | 2018-11-20 12:31:24 +0000 | [diff] [blame] | 404 | { "normalization_layer_in_map_nchw", "normalization_layer.cl" }, |
| 405 | { "normalization_layer_in_map_nhwc", "normalization_layer.cl" }, |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 406 | { "normalize_planar_yuv_layer_nchw", "normalize_planar_yuv_layer.cl" }, |
| 407 | { "normalize_planar_yuv_layer_nhwc", "normalize_planar_yuv_layer.cl" }, |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 408 | { "normalize_planar_yuv_layer_q8_nchw", "normalize_planar_yuv_layer_quantized.cl" }, |
| 409 | { "normalize_planar_yuv_layer_q8_nhwc", "normalize_planar_yuv_layer_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 410 | { "NV12_to_IYUV_bt709", "color_convert.cl" }, |
| 411 | { "NV12_to_RGB888_bt709", "color_convert.cl" }, |
| 412 | { "NV12_to_RGBA8888_bt709", "color_convert.cl" }, |
| 413 | { "NV12_to_YUV444_bt709", "color_convert.cl" }, |
| 414 | { "NV21_to_IYUV_bt709", "color_convert.cl" }, |
| 415 | { "NV21_to_RGB888_bt709", "color_convert.cl" }, |
| 416 | { "NV21_to_RGBA8888_bt709", "color_convert.cl" }, |
| 417 | { "NV21_to_YUV444_bt709", "color_convert.cl" }, |
Giorgio Arena | 5c4a8e9 | 2019-08-28 17:55:07 +0100 | [diff] [blame] | 418 | { "pad_layer_constant", "pad_layer.cl" }, |
| 419 | { "pad_layer_symmetric_reflect", "pad_layer.cl" }, |
shubham | e1a4e37 | 2019-01-07 21:37:55 +0530 | [diff] [blame] | 420 | { "permute", "permute.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 421 | { "pixelwise_mul_complex", "pixelwise_mul_float.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 422 | { "pixelwise_mul_float", "pixelwise_mul_float.cl" }, |
| 423 | { "pixelwise_mul_int", "pixelwise_mul_int.cl" }, |
Georgios Pinitas | bf28a3c | 2018-09-18 14:34:48 +0100 | [diff] [blame] | 424 | { "pixelwise_mul_quantized", "pixelwise_mul_int.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 425 | { "pooling_layer_2", "pooling_layer.cl" }, |
| 426 | { "pooling_layer_3", "pooling_layer.cl" }, |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 427 | { "pooling_layer_optimized_3", "pooling_layer.cl" }, |
Georgios Pinitas | ce09314 | 2017-06-19 16:11:53 +0100 | [diff] [blame] | 428 | { "pooling_layer_7", "pooling_layer.cl" }, |
Michalis Spyrou | e74b201 | 2018-04-18 09:49:16 +0100 | [diff] [blame] | 429 | { "pooling_layer_MxN_nchw", "pooling_layer.cl" }, |
| 430 | { "pooling_layer_MxN_nhwc", "pooling_layer.cl" }, |
| 431 | { "pooling_layer_MxN_quantized_nhwc", "pooling_layer_quantized.cl" }, |
| 432 | { "pooling_layer_MxN_quantized_nchw", "pooling_layer_quantized.cl" }, |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 433 | { "prior_box_layer_nchw", "prior_box_layer.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 434 | { "quantization_layer", "quantization_layer.cl" }, |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 435 | { "range", "range.cl" }, |
| 436 | { "range_quantized", "range.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 437 | { "reduction_operation_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7930db4 | 2018-11-22 17:36:28 +0000 | [diff] [blame] | 438 | { "reduction_operation_non_parallel_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 439 | { "reduction_operation_y", "reduction_operation.cl" }, |
| 440 | { "reduction_operation_z", "reduction_operation.cl" }, |
| 441 | { "reduction_operation_w", "reduction_operation.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 442 | { "remap_nearest_neighbour", "remap.cl" }, |
| 443 | { "remap_bilinear", "remap.cl" }, |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 444 | { "reorg_layer_nchw", "reorg_layer.cl" }, |
| 445 | { "reorg_layer_nhwc", "reorg_layer.cl" }, |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 446 | { "reshape_layer", "reshape_layer.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 447 | { "reshape_to_columns", "convolution_layer.cl" }, |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 448 | { "reverse", "reverse.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 449 | { "RGB888_to_IYUV_bt709", "color_convert.cl" }, |
| 450 | { "RGB888_to_NV12_bt709", "color_convert.cl" }, |
| 451 | { "RGB888_to_RGBA8888_bt709", "color_convert.cl" }, |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 452 | { "RGB888_to_U8_bt709", "color_convert.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 453 | { "RGB888_to_YUV444_bt709", "color_convert.cl" }, |
| 454 | { "RGBA8888_to_IYUV_bt709", "color_convert.cl" }, |
| 455 | { "RGBA8888_to_NV12_bt709", "color_convert.cl" }, |
| 456 | { "RGBA8888_to_RGB888_bt709", "color_convert.cl" }, |
| 457 | { "RGBA8888_to_YUV444_bt709", "color_convert.cl" }, |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 458 | { "roi_align_layer", "roi_align_layer.cl" }, |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 459 | { "roi_align_layer_quantized", "roi_align_layer_quantized.cl" }, |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 460 | { "roi_pooling_layer", "roi_pooling_layer.cl" }, |
Michalis Spyrou | 46da23f | 2018-04-10 13:41:30 +0100 | [diff] [blame] | 461 | { "scale_nearest_neighbour_nchw", "scale.cl" }, |
| 462 | { "scale_nearest_neighbour_nhwc", "scale.cl" }, |
| 463 | { "scale_bilinear_nchw", "scale.cl" }, |
| 464 | { "scale_bilinear_nhwc", "scale.cl" }, |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 465 | { "scale_bilinear_quantized_nchw", "scale_quantized.cl" }, |
| 466 | { "scale_bilinear_quantized_nhwc", "scale_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 467 | { "scharr3x3", "scharr_filter.cl" }, |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 468 | { "select_same_rank", "select.cl" }, |
| 469 | { "select_different_rank_2", "select.cl" }, |
| 470 | { "select_different_rank_n", "select.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 471 | { "sobel3x3", "sobel_filter.cl" }, |
| 472 | { "sobel_separable5x1", "sobel_filter.cl" }, |
| 473 | { "sobel_separable1x5", "sobel_filter.cl" }, |
| 474 | { "sobel_separable7x1", "sobel_filter.cl" }, |
| 475 | { "sobel_separable1x7", "sobel_filter.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 476 | { "softmax_layer_norm", "softmax_layer.cl" }, |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 477 | { "softmax_layer_norm_quantized", "softmax_layer_quantized.cl" }, |
Giorgio Arena | 4402cb9 | 2018-02-15 13:37:40 +0000 | [diff] [blame] | 478 | { "softmax_layer_max_shift_exp_sum_quantized_serial", "softmax_layer_quantized.cl" }, |
| 479 | { "softmax_layer_max_shift_exp_sum_quantized_parallel", "softmax_layer_quantized.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 480 | { "softmax_layer_max_shift_exp_sum_serial", "softmax_layer.cl" }, |
Michalis Spyrou | 13a51e1 | 2018-09-18 13:09:30 +0100 | [diff] [blame] | 481 | { "space_to_batch_nchw", "space_to_batch.cl" }, |
| 482 | { "space_to_batch_static_nchw", "space_to_batch.cl" }, |
| 483 | { "space_to_batch_nhwc", "space_to_batch.cl" }, |
| 484 | { "space_to_batch_static_nhwc", "space_to_batch.cl" }, |
Michalis Spyrou | d69b3b2 | 2019-05-29 17:03:38 +0100 | [diff] [blame] | 485 | { "space_to_depth_nchw", "space_to_depth.cl" }, |
| 486 | { "space_to_depth_nhwc", "space_to_depth.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 487 | { "softmax_layer_max_shift_exp_sum_parallel", "softmax_layer.cl" }, |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 488 | { "stack_layer", "stack_layer.cl" }, |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 489 | { "strided_slice", "slice_ops.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 490 | { "suppress_non_maximum", "canny.cl" }, |
| 491 | { "tablelookup_U8", "tablelookup.cl" }, |
| 492 | { "tablelookup_S16", "tablelookup.cl" }, |
| 493 | { "threshold_binary", "threshold.cl" }, |
| 494 | { "threshold_range", "threshold.cl" }, |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 495 | { "tile", "tile.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 496 | { "transpose", "transpose.cl" }, |
| 497 | { "UYVY422_to_IYUV_bt709", "color_convert.cl" }, |
| 498 | { "UYVY422_to_NV12_bt709", "color_convert.cl" }, |
| 499 | { "UYVY422_to_RGB888_bt709", "color_convert.cl" }, |
| 500 | { "UYVY422_to_RGBA8888_bt709", "color_convert.cl" }, |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 501 | { "upsample_layer_nchw", "upsample_layer.cl" }, |
| 502 | { "upsample_layer_nhwc", "upsample_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 503 | { "warp_affine_nearest_neighbour", "warp_affine.cl" }, |
| 504 | { "warp_affine_bilinear", "warp_affine.cl" }, |
| 505 | { "warp_perspective_nearest_neighbour", "warp_perspective.cl" }, |
| 506 | { "warp_perspective_bilinear", "warp_perspective.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 507 | { "winograd_filter_transform_2x2_3x3_nchw", "winograd_filter_transform.cl" }, |
| 508 | { "winograd_filter_transform_2x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 509 | { "winograd_filter_transform_1x2_1x3_nchw", "winograd_filter_transform.cl" }, |
| 510 | { "winograd_filter_transform_4x4_3x3_nchw", "winograd_filter_transform.cl" }, |
| 511 | { "winograd_filter_transform_4x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 512 | { "winograd_filter_transform_1x4_1x3_nchw", "winograd_filter_transform.cl" }, |
| 513 | { "winograd_filter_transform_4x4_5x5_nchw", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 514 | { "winograd_filter_transform_4x1_5x1_nchw", "winograd_filter_transform.cl" }, |
| 515 | { "winograd_filter_transform_1x4_1x5_nchw", "winograd_filter_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 516 | { "winograd_filter_transform_4x1_3x1_nhwc", "winograd_filter_transform.cl" }, |
| 517 | { "winograd_filter_transform_1x4_1x3_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 518 | { "winograd_filter_transform_4x4_3x3_nhwc", "winograd_filter_transform.cl" }, |
| 519 | { "winograd_filter_transform_4x4_5x5_nhwc", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 520 | { "winograd_filter_transform_4x1_5x1_nhwc", "winograd_filter_transform.cl" }, |
| 521 | { "winograd_filter_transform_1x4_1x5_nhwc", "winograd_filter_transform.cl" }, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 522 | { "winograd_filter_transform_2x2_7x7_nhwc", "winograd_filter_transform.cl" }, |
| 523 | { "winograd_filter_transform_2x1_7x1_nhwc", "winograd_filter_transform.cl" }, |
| 524 | { "winograd_filter_transform_1x2_1x7_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 525 | { "winograd_input_transform_2x2_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 526 | { "winograd_input_transform_2x2_3x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 527 | { "winograd_input_transform_2x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 528 | { "winograd_input_transform_2x1_3x1_stepz2_nchw", "winograd_input_transform.cl" }, |
| 529 | { "winograd_input_transform_1x2_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 530 | { "winograd_input_transform_1x2_1x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 531 | { "winograd_input_transform_4x4_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 532 | { "winograd_input_transform_4x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 533 | { "winograd_input_transform_1x4_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 534 | { "winograd_input_transform_4x4_5x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 535 | { "winograd_input_transform_4x1_5x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 536 | { "winograd_input_transform_1x4_1x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 537 | { "winograd_input_transform_4x1_3x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 538 | { "winograd_input_transform_1x4_1x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 539 | { "winograd_input_transform_4x4_3x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 540 | { "winograd_input_transform_4x4_5x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 541 | { "winograd_input_transform_4x1_5x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 542 | { "winograd_input_transform_1x4_1x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 543 | { "winograd_input_transform_2x2_7x7_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 544 | { "winograd_input_transform_2x1_7x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 545 | { "winograd_input_transform_1x2_1x7_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 546 | { "winograd_output_transform_2x2_3x3_nchw", "winograd_output_transform.cl" }, |
| 547 | { "winograd_output_transform_2x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 548 | { "winograd_output_transform_1x2_1x3_nchw", "winograd_output_transform.cl" }, |
| 549 | { "winograd_output_transform_4x4_3x3_nchw", "winograd_output_transform.cl" }, |
| 550 | { "winograd_output_transform_4x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 551 | { "winograd_output_transform_1x4_1x3_nchw", "winograd_output_transform.cl" }, |
| 552 | { "winograd_output_transform_4x4_5x5_nchw", "winograd_output_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 553 | { "winograd_output_transform_4x1_5x1_nchw", "winograd_output_transform.cl" }, |
| 554 | { "winograd_output_transform_1x4_1x5_nchw", "winograd_output_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 555 | { "winograd_output_transform_4x1_3x1_nhwc", "winograd_output_transform.cl" }, |
| 556 | { "winograd_output_transform_1x4_1x3_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 557 | { "winograd_output_transform_4x4_3x3_nhwc", "winograd_output_transform.cl" }, |
| 558 | { "winograd_output_transform_4x4_5x5_nhwc", "winograd_output_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 559 | { "winograd_output_transform_4x1_5x1_nhwc", "winograd_output_transform.cl" }, |
| 560 | { "winograd_output_transform_1x4_1x5_nhwc", "winograd_output_transform.cl" }, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 561 | { "winograd_output_transform_2x2_7x7_nhwc", "winograd_output_transform.cl" }, |
| 562 | { "winograd_output_transform_2x1_7x1_nhwc", "winograd_output_transform.cl" }, |
| 563 | { "winograd_output_transform_1x2_1x7_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 564 | { "yolo_layer_nchw", "yolo_layer.cl" }, |
| 565 | { "yolo_layer_nhwc", "yolo_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 566 | { "YUYV422_to_IYUV_bt709", "color_convert.cl" }, |
| 567 | { "YUYV422_to_NV12_bt709", "color_convert.cl" }, |
| 568 | { "YUYV422_to_RGB888_bt709", "color_convert.cl" }, |
| 569 | { "YUYV422_to_RGBA8888_bt709", "color_convert.cl" }, |
| 570 | }; |
| 571 | |
| 572 | const std::map<std::string, std::string> CLKernelLibrary::_program_source_map = |
| 573 | { |
| 574 | #ifdef EMBEDDED_KERNELS |
| 575 | { |
| 576 | "absdiff.cl", |
| 577 | #include "./cl_kernels/absdiff.clembed" |
| 578 | }, |
| 579 | { |
| 580 | "accumulate.cl", |
| 581 | #include "./cl_kernels/accumulate.clembed" |
| 582 | }, |
| 583 | { |
| 584 | "activation_layer.cl", |
| 585 | #include "./cl_kernels/activation_layer.clembed" |
| 586 | }, |
| 587 | { |
Manuel Bottini | 30dbeef | 2019-06-26 16:23:03 +0100 | [diff] [blame] | 588 | "activation_layer_quant.cl", |
| 589 | #include "./cl_kernels/activation_layer_quant.clembed" |
Michel Iwaniec | 0063380 | 2017-10-12 14:14:15 +0100 | [diff] [blame] | 590 | }, |
| 591 | { |
Manuel Bottini | 7b9998d | 2019-10-21 17:59:07 +0100 | [diff] [blame^] | 592 | "arg_min_max.cl", |
| 593 | #include "./cl_kernels/arg_min_max.clembed" |
| 594 | }, |
| 595 | { |
Michalis Spyrou | 6a8d3b6 | 2018-08-31 10:07:09 +0100 | [diff] [blame] | 596 | "batch_to_space.cl", |
| 597 | #include "./cl_kernels/batch_to_space.clembed" |
| 598 | }, |
| 599 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 600 | "bitwise_op.cl", |
| 601 | #include "./cl_kernels/bitwise_op.clembed" |
| 602 | }, |
| 603 | { |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 604 | "bounding_box_transform.cl", |
| 605 | #include "./cl_kernels/bounding_box_transform.clembed" |
| 606 | }, |
| 607 | { |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 608 | "bounding_box_transform_quantized.cl", |
| 609 | #include "./cl_kernels/bounding_box_transform_quantized.clembed" |
| 610 | }, |
| 611 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 612 | "canny.cl", |
| 613 | #include "./cl_kernels/canny.clembed" |
| 614 | }, |
| 615 | { |
| 616 | "channel_combine.cl", |
| 617 | #include "./cl_kernels/channel_combine.clembed" |
| 618 | }, |
| 619 | { |
| 620 | "channel_extract.cl", |
| 621 | #include "./cl_kernels/channel_extract.clembed" |
| 622 | }, |
| 623 | { |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 624 | "channel_shuffle.cl", |
| 625 | #include "./cl_kernels/channel_shuffle.clembed" |
| 626 | }, |
| 627 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 628 | "col2im.cl", |
| 629 | #include "./cl_kernels/col2im.clembed" |
| 630 | }, |
| 631 | { |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 632 | "comparisons.cl", |
| 633 | #include "./cl_kernels/comparisons.clembed" |
| 634 | }, |
| 635 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 636 | "concatenate.cl", |
| 637 | #include "./cl_kernels/concatenate.clembed" |
| 638 | }, |
| 639 | { |
| 640 | "color_convert.cl", |
| 641 | #include "./cl_kernels/color_convert.clembed" |
| 642 | }, |
| 643 | { |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 644 | "convert_fc_weights.cl", |
| 645 | #include "./cl_kernels/convert_fc_weights.clembed" |
| 646 | }, |
| 647 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 648 | "convolution3x3.cl", |
| 649 | #include "./cl_kernels/convolution3x3.clembed" |
| 650 | }, |
| 651 | { |
| 652 | "convolution5x5.cl", |
| 653 | #include "./cl_kernels/convolution5x5.clembed" |
| 654 | }, |
| 655 | { |
| 656 | "convolution7x7.cl", |
| 657 | #include "./cl_kernels/convolution7x7.clembed" |
| 658 | }, |
| 659 | { |
| 660 | "convolution9x9.cl", |
| 661 | #include "./cl_kernels/convolution9x9.clembed" |
| 662 | }, |
| 663 | { |
| 664 | "convolution_layer.cl", |
| 665 | #include "./cl_kernels/convolution_layer.clembed" |
| 666 | }, |
| 667 | { |
| 668 | "convolution_rectangle.cl", |
| 669 | #include "./cl_kernels/convolution_rectangle.clembed" |
| 670 | }, |
| 671 | { |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 672 | "copy_tensor.cl", |
| 673 | #include "./cl_kernels/copy_tensor.clembed" |
| 674 | }, |
| 675 | { |
George Wort | 894066d | 2019-02-15 15:12:52 +0000 | [diff] [blame] | 676 | "crop_tensor.cl", |
| 677 | #include "./cl_kernels/crop_tensor.clembed" |
| 678 | }, |
| 679 | { |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 680 | "upsample_layer.cl", |
| 681 | #include "./cl_kernels/upsample_layer.clembed" |
| 682 | }, |
| 683 | { |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 684 | "deconvolution_layer.cl", |
| 685 | #include "./cl_kernels/deconvolution_layer.clembed" |
| 686 | }, |
| 687 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 688 | "depth_convert.cl", |
| 689 | #include "./cl_kernels/depth_convert.clembed" |
| 690 | }, |
| 691 | { |
Michalis Spyrou | 649962c | 2019-05-22 11:11:55 +0100 | [diff] [blame] | 692 | "depth_to_space.cl", |
| 693 | #include "./cl_kernels/depth_to_space.clembed" |
| 694 | }, |
| 695 | { |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 696 | "depthwise_convolution.cl", |
| 697 | #include "./cl_kernels/depthwise_convolution.clembed" |
| 698 | }, |
| 699 | { |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 700 | "depthwise_convolution_quantized.cl", |
| 701 | #include "./cl_kernels/depthwise_convolution_quantized.clembed" |
| 702 | }, |
| 703 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 704 | "dequantization_layer.cl", |
| 705 | #include "./cl_kernels/dequantization_layer.clembed" |
| 706 | }, |
| 707 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 708 | "derivative.cl", |
| 709 | #include "./cl_kernels/derivative.clembed" |
| 710 | }, |
| 711 | { |
| 712 | "dilate.cl", |
| 713 | #include "./cl_kernels/dilate.clembed" |
| 714 | }, |
| 715 | { |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 716 | "direct_convolution1x1.cl", |
| 717 | #include "./cl_kernels/direct_convolution1x1.clembed" |
| 718 | }, |
| 719 | { |
| 720 | "direct_convolution3x3.cl", |
| 721 | #include "./cl_kernels/direct_convolution3x3.clembed" |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 722 | }, |
| 723 | { |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 724 | "direct_convolution5x5.cl", |
| 725 | #include "./cl_kernels/direct_convolution5x5.clembed" |
| 726 | }, |
| 727 | { |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 728 | "direct_convolution_quantized.cl", |
| 729 | #include "./cl_kernels/direct_convolution_quantized.clembed" |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 730 | }, |
| 731 | { |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 732 | "direct_convolution9x9.cl", |
| 733 | #include "./cl_kernels/direct_convolution9x9.clembed" |
| 734 | }, |
| 735 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 736 | "elementwise_operation.cl", |
| 737 | #include "./cl_kernels/elementwise_operation.clembed" |
| 738 | }, |
| 739 | { |
| 740 | "elementwise_operation_quantized.cl", |
| 741 | #include "./cl_kernels/elementwise_operation_quantized.clembed" |
| 742 | }, |
| 743 | { |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 744 | "elementwise_unary.cl", |
| 745 | #include "./cl_kernels/elementwise_unary.clembed" |
| 746 | }, |
| 747 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 748 | "erode.cl", |
| 749 | #include "./cl_kernels/erode.clembed" |
| 750 | }, |
| 751 | { |
| 752 | "fast_corners.cl", |
| 753 | #include "./cl_kernels/fast_corners.clembed" |
| 754 | }, |
| 755 | { |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 756 | "fft.cl", |
| 757 | #include "./cl_kernels/fft.clembed" |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 758 | }, |
| 759 | { |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 760 | "fft_digit_reverse.cl", |
| 761 | #include "./cl_kernels/fft_digit_reverse.clembed" |
| 762 | }, |
| 763 | { |
| 764 | "fft_scale.cl", |
| 765 | #include "./cl_kernels/fft_scale.clembed" |
| 766 | }, |
| 767 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 768 | "fill_border.cl", |
| 769 | #include "./cl_kernels/fill_border.clembed" |
| 770 | }, |
| 771 | { |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 772 | "flatten.cl", |
| 773 | #include "./cl_kernels/flatten.clembed" |
| 774 | }, |
| 775 | { |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 776 | "floor.cl", |
| 777 | #include "./cl_kernels/floor.clembed" |
| 778 | }, |
| 779 | { |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 780 | "gather.cl", |
| 781 | #include "./cl_kernels/gather.clembed" |
| 782 | }, |
| 783 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 784 | "gaussian_pyramid.cl", |
| 785 | #include "./cl_kernels/gaussian_pyramid.clembed" |
| 786 | }, |
| 787 | { |
| 788 | "gemm.cl", |
| 789 | #include "./cl_kernels/gemm.clembed" |
| 790 | }, |
| 791 | { |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 792 | "gemmlowp.cl", |
| 793 | #include "./cl_kernels/gemmlowp.clembed" |
| 794 | }, |
| 795 | { |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 796 | "gemv.cl", |
| 797 | #include "./cl_kernels/gemv.clembed" |
| 798 | }, |
| 799 | { |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 800 | "generate_proposals.cl", |
| 801 | #include "./cl_kernels/generate_proposals.clembed" |
| 802 | }, |
| 803 | { |
Michele Di Giorgio | 6b612f5 | 2019-09-05 12:30:22 +0100 | [diff] [blame] | 804 | "generate_proposals_quantized.cl", |
| 805 | #include "./cl_kernels/generate_proposals_quantized.clembed" |
| 806 | }, |
| 807 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 808 | "harris_corners.cl", |
| 809 | #include "./cl_kernels/harris_corners.clembed" |
| 810 | }, |
| 811 | { |
| 812 | "helpers.h", |
| 813 | #include "./cl_kernels/helpers.hembed" |
| 814 | }, |
| 815 | { |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 816 | "helpers_asymm.h", |
| 817 | #include "./cl_kernels/helpers_asymm.hembed" |
| 818 | }, |
| 819 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 820 | "histogram.cl", |
| 821 | #include "./cl_kernels/histogram.clembed" |
| 822 | }, |
| 823 | { |
| 824 | "hog.cl", |
| 825 | #include "./cl_kernels/hog.clembed" |
| 826 | }, |
| 827 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 828 | "im2col.cl", |
| 829 | #include "./cl_kernels/im2col.clembed" |
| 830 | }, |
| 831 | { |
Manuel Bottini | 79f88e6 | 2019-09-18 15:02:53 +0100 | [diff] [blame] | 832 | "instance_normalization.cl", |
| 833 | #include "./cl_kernels/instance_normalization.clembed" |
| 834 | }, |
| 835 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 836 | "integral_image.cl", |
| 837 | #include "./cl_kernels/integral_image.clembed" |
| 838 | }, |
| 839 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 840 | "l2_normalize.cl", |
| 841 | #include "./cl_kernels/l2_normalize.clembed" |
| 842 | }, |
| 843 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 844 | "magnitude_phase.cl", |
| 845 | #include "./cl_kernels/magnitude_phase.clembed" |
| 846 | }, |
| 847 | { |
| 848 | "mean_stddev.cl", |
| 849 | #include "./cl_kernels/mean_stddev.clembed" |
| 850 | }, |
| 851 | { |
Michele Di Giorgio | 5b48ad7 | 2019-06-04 18:43:35 +0100 | [diff] [blame] | 852 | "mean_stddev_normalization.cl", |
| 853 | #include "./cl_kernels/mean_stddev_normalization.clembed" |
| 854 | }, |
| 855 | { |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 856 | "memset.cl", |
| 857 | #include "./cl_kernels/memset.clembed" |
| 858 | }, |
| 859 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 860 | "minmaxloc.cl", |
| 861 | #include "./cl_kernels/minmaxloc.clembed" |
| 862 | }, |
| 863 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 864 | "minmax_layer.cl", |
| 865 | #include "./cl_kernels/minmax_layer.clembed" |
| 866 | }, |
| 867 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 868 | "non_linear_filter3x3.cl", |
| 869 | #include "./cl_kernels/non_linear_filter3x3.clembed" |
| 870 | }, |
| 871 | { |
| 872 | "non_linear_filter5x5.cl", |
| 873 | #include "./cl_kernels/non_linear_filter5x5.clembed" |
| 874 | }, |
| 875 | { |
| 876 | "non_linear_filter_helpers.h", |
| 877 | #include "./cl_kernels/non_linear_filter_helpers.hembed" |
| 878 | }, |
| 879 | { |
| 880 | "nonmax.cl", |
| 881 | #include "./cl_kernels/nonmax.clembed" |
| 882 | }, |
| 883 | { |
| 884 | "normalization_layer.cl", |
| 885 | #include "./cl_kernels/normalization_layer.clembed" |
| 886 | }, |
| 887 | { |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 888 | "normalize_planar_yuv_layer.cl", |
| 889 | #include "./cl_kernels/normalize_planar_yuv_layer.clembed" |
| 890 | }, |
| 891 | { |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 892 | "normalize_planar_yuv_layer_quantized.cl", |
| 893 | #include "./cl_kernels/normalize_planar_yuv_layer_quantized.clembed" |
| 894 | }, |
| 895 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 896 | "batchnormalization_layer.cl", |
| 897 | #include "./cl_kernels/batchnormalization_layer.clembed" |
| 898 | }, |
| 899 | { |
| 900 | "optical_flow_pyramid_lk.cl", |
| 901 | #include "./cl_kernels/optical_flow_pyramid_lk.clembed" |
| 902 | }, |
| 903 | { |
Giorgio Arena | 205eed8 | 2019-08-14 10:13:50 +0100 | [diff] [blame] | 904 | "pad_layer.cl", |
| 905 | #include "./cl_kernels/pad_layer.clembed" |
| 906 | }, |
| 907 | { |
Michalis Spyrou | 5237e01 | 2018-01-17 09:40:27 +0000 | [diff] [blame] | 908 | "permute.cl", |
| 909 | #include "./cl_kernels/permute.clembed" |
| 910 | }, |
| 911 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 912 | "pixelwise_mul_float.cl", |
| 913 | #include "./cl_kernels/pixelwise_mul_float.clembed" |
| 914 | }, |
| 915 | { |
| 916 | "pixelwise_mul_int.cl", |
| 917 | #include "./cl_kernels/pixelwise_mul_int.clembed" |
| 918 | }, |
| 919 | { |
| 920 | "pooling_layer.cl", |
| 921 | #include "./cl_kernels/pooling_layer.clembed" |
| 922 | }, |
| 923 | { |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 924 | "pooling_layer_quantized.cl", |
| 925 | #include "./cl_kernels/pooling_layer_quantized.clembed" |
| 926 | }, |
| 927 | { |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 928 | "prior_box_layer.cl", |
| 929 | #include "./cl_kernels/prior_box_layer.clembed" |
| 930 | }, |
| 931 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 932 | "quantization_layer.cl", |
| 933 | #include "./cl_kernels/quantization_layer.clembed" |
| 934 | }, |
| 935 | { |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 936 | "range.cl", |
| 937 | #include "./cl_kernels/range.clembed" |
| 938 | }, |
| 939 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 940 | "reduction_operation.cl", |
| 941 | #include "./cl_kernels/reduction_operation.clembed" |
| 942 | }, |
| 943 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 944 | "remap.cl", |
| 945 | #include "./cl_kernels/remap.clembed" |
| 946 | }, |
| 947 | { |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 948 | "reorg_layer.cl", |
| 949 | #include "./cl_kernels/reorg_layer.clembed" |
| 950 | }, |
| 951 | { |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 952 | "reshape_layer.cl", |
| 953 | #include "./cl_kernels/reshape_layer.clembed" |
| 954 | }, |
| 955 | { |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 956 | "reverse.cl", |
| 957 | #include "./cl_kernels/reverse.clembed" |
| 958 | }, |
| 959 | { |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 960 | "roi_align_layer.cl", |
| 961 | #include "./cl_kernels/roi_align_layer.clembed" |
| 962 | }, |
| 963 | { |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 964 | "roi_align_layer_quantized.cl", |
| 965 | #include "./cl_kernels/roi_align_layer_quantized.clembed" |
| 966 | }, |
| 967 | { |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 968 | "roi_pooling_layer.cl", |
| 969 | #include "./cl_kernels/roi_pooling_layer.clembed" |
| 970 | }, |
| 971 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 972 | "scale.cl", |
| 973 | #include "./cl_kernels/scale.clembed" |
| 974 | }, |
| 975 | { |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 976 | "scale_quantized.cl", |
| 977 | #include "./cl_kernels/scale_quantized.clembed" |
| 978 | }, |
| 979 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 980 | "scharr_filter.cl", |
| 981 | #include "./cl_kernels/scharr_filter.clembed" |
| 982 | }, |
| 983 | { |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 984 | "select.cl", |
| 985 | #include "./cl_kernels/select.clembed" |
| 986 | }, |
| 987 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 988 | "sobel_filter.cl", |
| 989 | #include "./cl_kernels/sobel_filter.clembed" |
| 990 | }, |
| 991 | { |
| 992 | "softmax_layer.cl", |
| 993 | #include "./cl_kernels/softmax_layer.clembed" |
| 994 | }, |
| 995 | { |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 996 | "softmax_layer_quantized.cl", |
| 997 | #include "./cl_kernels/softmax_layer_quantized.clembed" |
| 998 | }, |
| 999 | { |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 1000 | "slice_ops.cl", |
| 1001 | #include "./cl_kernels/slice_ops.clembed" |
Georgios Pinitas | 77589b5 | 2018-08-21 14:41:35 +0100 | [diff] [blame] | 1002 | }, |
| 1003 | { |
Michalis Spyrou | 16934a5 | 2018-08-21 18:03:58 +0100 | [diff] [blame] | 1004 | "space_to_batch.cl", |
| 1005 | #include "./cl_kernels/space_to_batch.clembed" |
| 1006 | }, |
| 1007 | { |
Michalis Spyrou | d69b3b2 | 2019-05-29 17:03:38 +0100 | [diff] [blame] | 1008 | "space_to_depth.cl", |
| 1009 | #include "./cl_kernels/space_to_depth.clembed" |
| 1010 | }, |
| 1011 | { |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 1012 | "stack_layer.cl", |
| 1013 | #include "./cl_kernels/stack_layer.clembed" |
| 1014 | }, |
| 1015 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1016 | "tablelookup.cl", |
| 1017 | #include "./cl_kernels/tablelookup.clembed" |
| 1018 | }, |
| 1019 | { |
| 1020 | "threshold.cl", |
| 1021 | #include "./cl_kernels/threshold.clembed" |
| 1022 | }, |
| 1023 | { |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 1024 | "tile.cl", |
| 1025 | #include "./cl_kernels/tile.clembed" |
| 1026 | }, |
| 1027 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1028 | "transpose.cl", |
| 1029 | #include "./cl_kernels/transpose.clembed" |
| 1030 | }, |
| 1031 | { |
| 1032 | "types.h", |
| 1033 | #include "./cl_kernels/types.hembed" |
| 1034 | }, |
| 1035 | { |
| 1036 | "warp_affine.cl", |
| 1037 | #include "./cl_kernels/warp_affine.clembed" |
| 1038 | }, |
| 1039 | { |
| 1040 | "warp_helpers.h", |
| 1041 | #include "./cl_kernels/warp_helpers.hembed" |
| 1042 | }, |
| 1043 | { |
| 1044 | "warp_perspective.cl", |
| 1045 | #include "./cl_kernels/warp_perspective.clembed" |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1046 | }, |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 1047 | { |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 1048 | "winograd_filter_transform.cl", |
| 1049 | #include "./cl_kernels/winograd_filter_transform.clembed" |
| 1050 | }, |
| 1051 | { |
| 1052 | "winograd_input_transform.cl", |
| 1053 | #include "./cl_kernels/winograd_input_transform.clembed" |
| 1054 | }, |
| 1055 | { |
| 1056 | "winograd_output_transform.cl", |
| 1057 | #include "./cl_kernels/winograd_output_transform.clembed" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 1058 | }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 1059 | { |
| 1060 | "yolo_layer.cl", |
| 1061 | #include "./cl_kernels/yolo_layer.clembed" |
| 1062 | }, |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 1063 | #endif /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1064 | }; |
| 1065 | |
| 1066 | CLKernelLibrary::CLKernelLibrary() |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1067 | : _context(), _device(), _kernel_path("."), _programs_map(), _built_programs_map() |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1068 | { |
Anthony Barbier | ecb1c62 | 2018-04-17 11:45:10 +0100 | [diff] [blame] | 1069 | 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] | 1070 | } |
| 1071 | |
| 1072 | CLKernelLibrary &CLKernelLibrary::get() |
| 1073 | { |
| 1074 | static CLKernelLibrary _kernel_library; |
| 1075 | return _kernel_library; |
| 1076 | } |
| 1077 | |
| 1078 | Kernel CLKernelLibrary::create_kernel(const std::string &kernel_name, const StringSet &build_options_set) const |
| 1079 | { |
| 1080 | // Find which program contains the kernel |
| 1081 | auto kernel_program_it = _kernel_program_map.find(kernel_name); |
| 1082 | |
| 1083 | if(_kernel_program_map.end() == kernel_program_it) |
| 1084 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 1085 | 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] | 1086 | } |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1087 | std::string concat_str; |
| 1088 | |
Georgios Pinitas | df473ea | 2018-05-31 18:53:52 +0100 | [diff] [blame] | 1089 | #if defined(ARM_COMPUTE_DEBUG_ENABLED) |
| 1090 | // Enable debug properties in CL kernels |
| 1091 | concat_str += " -DARM_COMPUTE_DEBUG_ENABLED"; |
| 1092 | #endif // defined(ARM_COMPUTE_DEBUG_ENABLED) |
| 1093 | |
Usama Arif | e2428a0 | 2019-05-09 11:03:17 +0100 | [diff] [blame] | 1094 | GPUTarget gpu_arch = get_arch_from_target(get_target_from_device(_device)); |
| 1095 | concat_str += " -DGPU_ARCH=" + support::cpp11::to_string( |
| 1096 | static_cast<std::underlying_type<GPUTarget>::type>(gpu_arch)); |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 1097 | if(fp16_supported()) |
Matthew Bentham | 6f31f8c | 2017-10-27 11:50:06 +0100 | [diff] [blame] | 1098 | { |
| 1099 | concat_str += " -DARM_COMPUTE_OPENCL_FP16_ENABLED=1 "; |
| 1100 | } |
| 1101 | |
Michalis Spyrou | e03342e | 2018-01-15 14:39:13 +0000 | [diff] [blame] | 1102 | if(dot8_supported(_device)) |
| 1103 | { |
| 1104 | concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ENABLED=1 "; |
| 1105 | } |
| 1106 | |
Giorgio Arena | eff8d95 | 2018-07-02 15:29:57 +0100 | [diff] [blame] | 1107 | if(dot8_acc_supported(_device)) |
| 1108 | { |
| 1109 | concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ACC_ENABLED=1 "; |
| 1110 | } |
| 1111 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 1112 | if(get_cl_version(_device) == CLVersion::CL20) |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1113 | { |
| 1114 | concat_str += " -cl-std=CL2.0 "; |
| 1115 | } |
Anthony Barbier | d727e85 | 2018-04-20 11:05:29 +0100 | [diff] [blame] | 1116 | else if(arm_non_uniform_workgroup_supported(_device)) |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 1117 | { |
| 1118 | concat_str += " -cl-arm-non-uniform-work-group-size "; |
| 1119 | } |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1120 | else |
| 1121 | { |
| 1122 | ARM_COMPUTE_ERROR("Non uniform workgroup size is not supported!!"); |
| 1123 | } |
| 1124 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1125 | // Check if the program has been built before with same build options. |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1126 | const std::string program_name = kernel_program_it->second; |
| 1127 | const std::string build_options = stringify_set(build_options_set) + concat_str; |
| 1128 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1129 | const std::string built_program_name = program_name + "_" + build_options; |
| 1130 | auto built_program_it = _built_programs_map.find(built_program_name); |
| 1131 | |
| 1132 | cl::Program cl_program; |
| 1133 | |
| 1134 | if(_built_programs_map.end() != built_program_it) |
| 1135 | { |
| 1136 | // If program has been built, retrieve to create kernel from it |
| 1137 | cl_program = built_program_it->second; |
| 1138 | } |
| 1139 | else |
| 1140 | { |
| 1141 | // Get program |
| 1142 | Program program = load_program(program_name); |
| 1143 | |
| 1144 | // Build program |
| 1145 | cl_program = program.build(build_options); |
| 1146 | |
| 1147 | // Add built program to internal map |
| 1148 | _built_programs_map.emplace(built_program_name, cl_program); |
| 1149 | } |
| 1150 | |
| 1151 | // Create and return kernel |
| 1152 | return Kernel(kernel_name, cl_program); |
| 1153 | } |
| 1154 | |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1155 | void CLKernelLibrary::init(std::string kernel_path, cl::Context context, cl::Device device) |
| 1156 | { |
| 1157 | _kernel_path = std::move(kernel_path); |
| 1158 | _context = std::move(context); |
| 1159 | _device = std::move(device); |
| 1160 | } |
| 1161 | |
| 1162 | void CLKernelLibrary::set_kernel_path(const std::string &kernel_path) |
| 1163 | { |
| 1164 | _kernel_path = kernel_path; |
| 1165 | } |
| 1166 | |
| 1167 | cl::Context &CLKernelLibrary::context() |
| 1168 | { |
| 1169 | return _context; |
| 1170 | } |
| 1171 | |
| 1172 | cl::Device &CLKernelLibrary::get_device() |
| 1173 | { |
| 1174 | return _device; |
| 1175 | } |
| 1176 | |
| 1177 | void CLKernelLibrary::set_device(cl::Device device) |
| 1178 | { |
| 1179 | _device = std::move(device); |
| 1180 | } |
| 1181 | |
| 1182 | std::string CLKernelLibrary::get_kernel_path() |
| 1183 | { |
| 1184 | return _kernel_path; |
| 1185 | } |
| 1186 | |
| 1187 | void CLKernelLibrary::clear_programs_cache() |
| 1188 | { |
| 1189 | _programs_map.clear(); |
| 1190 | _built_programs_map.clear(); |
| 1191 | } |
| 1192 | |
| 1193 | const std::map<std::string, cl::Program> &CLKernelLibrary::get_built_programs() const |
| 1194 | { |
| 1195 | return _built_programs_map; |
| 1196 | } |
| 1197 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 1198 | 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] | 1199 | { |
| 1200 | _built_programs_map.emplace(built_program_name, program); |
| 1201 | } |
| 1202 | |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 1203 | bool CLKernelLibrary::fp16_supported() const |
| 1204 | { |
| 1205 | return ::fp16_supported(_device); |
| 1206 | } |
| 1207 | |
Vidhya Sudhan Loganathan | 76c8564 | 2018-05-25 13:53:02 +0100 | [diff] [blame] | 1208 | bool CLKernelLibrary::int64_base_atomics_supported() const |
| 1209 | { |
| 1210 | return device_supports_extension(_device, "cl_khr_int64_base_atomics"); |
| 1211 | } |
| 1212 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1213 | const Program &CLKernelLibrary::load_program(const std::string &program_name) const |
| 1214 | { |
| 1215 | const auto program_it = _programs_map.find(program_name); |
| 1216 | |
| 1217 | if(program_it != _programs_map.end()) |
| 1218 | { |
| 1219 | return program_it->second; |
| 1220 | } |
| 1221 | |
| 1222 | Program program; |
| 1223 | |
| 1224 | #ifdef EMBEDDED_KERNELS |
| 1225 | const auto program_source_it = _program_source_map.find(program_name); |
| 1226 | |
| 1227 | if(_program_source_map.end() == program_source_it) |
| 1228 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 1229 | ARM_COMPUTE_ERROR_VAR("Embedded program for %s does not exist.", program_name.c_str()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1230 | } |
| 1231 | |
| 1232 | program = Program(_context, program_name, program_source_it->second); |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 1233 | #else /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1234 | // Check for binary |
| 1235 | std::string source_name = _kernel_path + program_name; |
| 1236 | std::string binary_name = source_name + "bin"; |
| 1237 | |
| 1238 | if(std::ifstream(binary_name).is_open()) |
| 1239 | { |
| 1240 | const std::string program_binary = read_file(binary_name, true); |
| 1241 | program = Program(_context, _device, program_name, std::vector<unsigned char>(program_binary.begin(), program_binary.end())); |
| 1242 | } |
| 1243 | else if(std::ifstream(source_name).is_open()) |
| 1244 | { |
| 1245 | program = Program(_context, program_name, read_file(source_name, false)); |
| 1246 | } |
| 1247 | else |
| 1248 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 1249 | ARM_COMPUTE_ERROR_VAR("Kernel file %s does not exist.", source_name.c_str()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1250 | } |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 1251 | #endif /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1252 | |
| 1253 | // Insert program to program map |
| 1254 | const auto new_program = _programs_map.emplace(program_name, std::move(program)); |
| 1255 | |
| 1256 | return new_program.first->second; |
| 1257 | } |
| 1258 | |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1259 | void CLKernelLibrary::set_context(cl::Context context) |
| 1260 | { |
| 1261 | _context = std::move(context); |
| 1262 | if(_context.get() == nullptr) |
| 1263 | { |
| 1264 | _device = cl::Device(); |
| 1265 | } |
| 1266 | else |
| 1267 | { |
| 1268 | const auto cl_devices = _context.getInfo<CL_CONTEXT_DEVICES>(); |
| 1269 | |
| 1270 | if(cl_devices.empty()) |
| 1271 | { |
| 1272 | _device = cl::Device(); |
| 1273 | } |
| 1274 | else |
| 1275 | { |
| 1276 | _device = cl_devices[0]; |
| 1277 | } |
| 1278 | } |
| 1279 | } |
| 1280 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1281 | std::string CLKernelLibrary::stringify_set(const StringSet &s) const |
| 1282 | { |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1283 | std::string concat_set; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1284 | |
| 1285 | #ifndef EMBEDDED_KERNELS |
| 1286 | concat_set += "-I" + _kernel_path + " "; |
| 1287 | #endif /* EMBEDDED_KERNELS */ |
| 1288 | |
| 1289 | // Concatenate set |
| 1290 | for(const auto &el : s) |
| 1291 | { |
| 1292 | concat_set += " " + el; |
| 1293 | } |
| 1294 | |
| 1295 | return concat_set; |
| 1296 | } |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1297 | |
| 1298 | std::string CLKernelLibrary::get_program_source(const std::string &program_name) |
| 1299 | { |
| 1300 | const auto program_source_it = _program_source_map.find(program_name); |
| 1301 | |
| 1302 | if(program_source_it == _program_source_map.end()) |
| 1303 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 1304 | 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] | 1305 | } |
| 1306 | |
| 1307 | return program_source_it->second; |
| 1308 | } |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1309 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1310 | size_t CLKernelLibrary::max_local_workgroup_size(const cl::Kernel &kernel) const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1311 | { |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1312 | size_t result; |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1313 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1314 | size_t err = kernel.getWorkGroupInfo(_device, CL_KERNEL_WORK_GROUP_SIZE, &result); |
| 1315 | ARM_COMPUTE_ERROR_ON_MSG(err != 0, "clGetKernelWorkGroupInfo failed to return the maximum workgroup size for the kernel"); |
| 1316 | ARM_COMPUTE_UNUSED(err); |
| 1317 | |
| 1318 | return result; |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1319 | } |
| 1320 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1321 | cl::NDRange CLKernelLibrary::default_ndrange() const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1322 | { |
Anthony Barbier | b6eb353 | 2018-08-08 13:20:04 +0100 | [diff] [blame] | 1323 | GPUTarget _target = get_target_from_device(_device); |
Michalis Spyrou | a967611 | 2018-02-22 18:07:43 +0000 | [diff] [blame] | 1324 | cl::NDRange default_range; |
| 1325 | |
| 1326 | switch(_target) |
| 1327 | { |
| 1328 | case GPUTarget::MIDGARD: |
| 1329 | case GPUTarget::T600: |
| 1330 | case GPUTarget::T700: |
| 1331 | case GPUTarget::T800: |
| 1332 | default_range = cl::NDRange(128u, 1); |
| 1333 | break; |
| 1334 | default: |
| 1335 | default_range = cl::NullRange; |
| 1336 | } |
| 1337 | |
| 1338 | return default_range; |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1339 | } |
Anthony Barbier | 847864d | 2018-03-07 11:35:53 +0000 | [diff] [blame] | 1340 | |
| 1341 | std::string CLKernelLibrary::get_device_version() |
| 1342 | { |
| 1343 | return _device.getInfo<CL_DEVICE_VERSION>(); |
| 1344 | } |
Giorgio Arena | 5d42b46 | 2019-07-26 15:54:20 +0100 | [diff] [blame] | 1345 | |
| 1346 | cl_uint CLKernelLibrary::get_num_compute_units() |
| 1347 | { |
| 1348 | return _device.getInfo<CL_DEVICE_MAX_COMPUTE_UNITS>(); |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 1349 | } |