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" }, |
Michel Iwaniec | 0063380 | 2017-10-12 14:14:15 +0100 | [diff] [blame] | 151 | { "activation_layer_qa8", "activation_layer_qa8.cl" }, |
Michalis Spyrou | f1addb6 | 2018-09-11 11:16:47 +0100 | [diff] [blame] | 152 | { "batch_to_space_nchw", "batch_to_space.cl" }, |
| 153 | { "batch_to_space_static_nchw", "batch_to_space.cl" }, |
| 154 | { "batch_to_space_nhwc", "batch_to_space.cl" }, |
| 155 | { "batch_to_space_static_nhwc", "batch_to_space.cl" }, |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 156 | { "batchnormalization_layer_nchw", "batchnormalization_layer.cl" }, |
| 157 | { "batchnormalization_layer_nhwc", "batchnormalization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 158 | { "bitwise_or", "bitwise_op.cl" }, |
| 159 | { "bitwise_and", "bitwise_op.cl" }, |
| 160 | { "bitwise_xor", "bitwise_op.cl" }, |
| 161 | { "bitwise_not", "bitwise_op.cl" }, |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 162 | { "bounding_box_transform", "bounding_box_transform.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 163 | { "channel_combine_NV", "channel_combine.cl" }, |
| 164 | { "channel_combine_RGB888", "channel_combine.cl" }, |
| 165 | { "channel_combine_RGBA8888", "channel_combine.cl" }, |
| 166 | { "channel_combine_UYVY422", "channel_combine.cl" }, |
| 167 | { "channel_combine_YUYV422", "channel_combine.cl" }, |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 168 | { "channel_shuffle_nchw", "channel_shuffle.cl" }, |
Gian Marco Iodice | 8bab0ee | 2018-09-13 11:51:56 +0100 | [diff] [blame] | 169 | { "channel_shuffle_nhwc", "channel_shuffle.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 170 | { "channel_extract_NV12", "channel_extract.cl" }, |
| 171 | { "channel_extract_NV21", "channel_extract.cl" }, |
| 172 | { "channel_extract_RGB888", "channel_extract.cl" }, |
| 173 | { "channel_extract_RGBA8888", "channel_extract.cl" }, |
| 174 | { "channel_extract_UYVY422", "channel_extract.cl" }, |
| 175 | { "channel_extract_YUYV422", "channel_extract.cl" }, |
| 176 | { "combine_gradients_L1", "canny.cl" }, |
| 177 | { "combine_gradients_L2", "canny.cl" }, |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 178 | { "compare_equal", "comparisons.cl" }, |
| 179 | { "compare_equal_quantized", "comparisons.cl" }, |
| 180 | { "compare_notequal", "comparisons.cl" }, |
| 181 | { "compare_notequal_quantized", "comparisons.cl" }, |
| 182 | { "compare_greater", "comparisons.cl" }, |
| 183 | { "compare_greater_quantized", "comparisons.cl" }, |
| 184 | { "compare_greaterequal", "comparisons.cl" }, |
| 185 | { "compare_greaterequal_quantized", "comparisons.cl" }, |
| 186 | { "compare_less", "comparisons.cl" }, |
| 187 | { "compare_less_quantized", "comparisons.cl" }, |
| 188 | { "compare_lessequal", "comparisons.cl" }, |
| 189 | { "compare_lessequal_quantized", "comparisons.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 190 | { "concatenate_depth", "concatenate.cl" }, |
Michalis Spyrou | 55b3d12 | 2018-05-09 09:59:23 +0100 | [diff] [blame] | 191 | { "concatenate_width", "concatenate.cl" }, |
Michele Di Giorgio | 27400b9 | 2018-11-01 13:44:05 +0000 | [diff] [blame] | 192 | { "concatenate_width_x2", "concatenate.cl" }, |
| 193 | { "concatenate_width_x4", "concatenate.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 194 | { "convolution_rectangle", "convolution_rectangle.cl" }, |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 195 | { "col2im", "col2im.cl" }, |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 196 | { "convert_depth_down", "depth_convert.cl" }, |
| 197 | { "convert_depth_up", "depth_convert.cl" }, |
| 198 | { "convert_fc_weights", "convert_fc_weights.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 199 | { "convolution3x3_static", "convolution3x3.cl" }, |
| 200 | { "convolution5x5_static", "convolution5x5.cl" }, |
| 201 | { "convolution7x7_static", "convolution7x7.cl" }, |
| 202 | { "convolution9x9_static", "convolution9x9.cl" }, |
| 203 | { "convolution_separable1x5_static", "convolution5x5.cl" }, |
| 204 | { "convolution_separable5x1_static", "convolution5x5.cl" }, |
| 205 | { "convolution_separable1x7_static", "convolution7x7.cl" }, |
| 206 | { "convolution_separable7x1_static", "convolution7x7.cl" }, |
| 207 | { "convolution_separable1x9_static", "convolution9x9.cl" }, |
| 208 | { "convolution_separable9x1_static", "convolution9x9.cl" }, |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 209 | { "copy_tensor", "copy_tensor.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 210 | { "copy_pad_tensor", "copy_tensor.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 211 | { "copy_plane", "channel_extract.cl" }, |
| 212 | { "copy_planes_3p", "channel_combine.cl" }, |
| 213 | { "copy_to_keypoint", "fast_corners.cl" }, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 214 | { "deconvolution_upsample", "deconvolution_layer.cl" }, |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 215 | { "depthwise_convolution_3x3", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 216 | { "depthwise_convolution_3x3_f16", "depthwise_convolution.cl" }, |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 217 | { "depthwise_convolution_3x3_nhwc", "depthwise_convolution.cl" }, |
| 218 | { "depthwise_convolution_3x3_nhwc_stride1", "depthwise_convolution.cl" }, |
Giorgio Arena | dfca60b | 2018-01-31 10:30:59 +0000 | [diff] [blame] | 219 | { "depthwise_convolution_3x3_quantized_nchw", "depthwise_convolution_quantized.cl" }, |
Giorgio Arena | eff8d95 | 2018-07-02 15:29:57 +0100 | [diff] [blame] | 220 | { "depthwise_convolution_3x3_quantized_nhwc", "depthwise_convolution_quantized.cl" }, |
Giorgio Arena | dfca60b | 2018-01-31 10:30:59 +0000 | [diff] [blame] | 221 | { "depthwise_convolution_3x3_quantized_nhwc_stride1", "depthwise_convolution_quantized.cl" }, |
Giorgio Arena | eff8d95 | 2018-07-02 15:29:57 +0100 | [diff] [blame] | 222 | { "depthwise_convolution_3x3_quantized_dot8_nchw", "depthwise_convolution_quantized.cl" }, |
| 223 | { "depthwise_convolution_3x3_quantized_dot8_nhwc_stride1", "depthwise_convolution_quantized.cl" }, |
Michele Di Giorgio | 3ebef32 | 2018-02-21 10:02:58 +0000 | [diff] [blame] | 224 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f16", "depthwise_convolution.cl" }, |
| 225 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f16", "depthwise_convolution.cl" }, |
| 226 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f32", "depthwise_convolution.cl" }, |
| 227 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f32", "depthwise_convolution.cl" }, |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 228 | { "depthwise_im2col", "depthwise_convolution.cl" }, |
| 229 | { "depthwise_vector_to_tensor", "depthwise_convolution.cl" }, |
| 230 | { "depthwise_weights_reshape", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 231 | { "dequantization_layer", "dequantization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 232 | { "derivative", "derivative.cl" }, |
| 233 | { "dilate", "dilate.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 234 | { "direct_convolution1x1", "direct_convolution1x1.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 235 | { "direct_convolution1x1_nhwc", "direct_convolution1x1.cl" }, |
Gian Marco Iodice | 1c8409d | 2017-09-06 17:24:25 +0100 | [diff] [blame] | 236 | { "direct_convolution1x1_f32_bifrost", "direct_convolution1x1.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 237 | { "direct_convolution3x3", "direct_convolution3x3.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 238 | { "direct_convolution3x3_nhwc", "direct_convolution3x3.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 239 | { "direct_convolution3x3_f32_bifrost", "direct_convolution3x3.cl" }, |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 240 | { "direct_convolution5x5", "direct_convolution5x5.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 241 | { "direct_convolution5x5_nhwc", "direct_convolution5x5.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 242 | { "direct_convolution5x5_f32_bifrost", "direct_convolution5x5.cl" }, |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 243 | { "direct_convolution_1x1_3x3_5x5_quantized", "direct_convolution_1x1_3x3_5x5_quantized.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 244 | { "elementwise_operation_ADD", "elementwise_operation.cl" }, |
| 245 | { "elementwise_operation_SUB", "elementwise_operation.cl" }, |
| 246 | { "elementwise_operation_MAX", "elementwise_operation.cl" }, |
| 247 | { "elementwise_operation_MIN", "elementwise_operation.cl" }, |
| 248 | { "elementwise_operation_DIV", "elementwise_operation.cl" }, |
| 249 | { "elementwise_operation_SQUARED_DIFF", "elementwise_operation.cl" }, |
| 250 | { "elementwise_operation_ADD_quantized", "elementwise_operation_quantized.cl" }, |
| 251 | { "elementwise_operation_SUB_quantized", "elementwise_operation_quantized.cl" }, |
| 252 | { "elementwise_operation_MAX_quantized", "elementwise_operation_quantized.cl" }, |
| 253 | { "elementwise_operation_MIN_quantized", "elementwise_operation_quantized.cl" }, |
| 254 | { "elementwise_operation_DIV_quantized", "elementwise_operation_quantized.cl" }, |
| 255 | { "elementwise_operation_SQUARED_DIFF_quantized", "elementwise_operation_quantized.cl" }, |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 256 | { "elementwise_unary", "elementwise_unary.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 257 | { "erode", "erode.cl" }, |
| 258 | { "fast_corners", "fast_corners.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 259 | { "flatten", "flatten.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 260 | { "fill_image_borders_constant", "fill_border.cl" }, |
| 261 | { "fill_image_borders_replicate", "fill_border.cl" }, |
| 262 | { "finalize", "optical_flow_pyramid_lk.cl" }, |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 263 | { "fuse_batchnormalization_layer", "batchnormalization_layer.cl" }, |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 264 | { "floor_layer", "floor.cl" }, |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 265 | { "gather", "gather.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 266 | { "gaussian1x5_sub_x", "gaussian_pyramid.cl" }, |
| 267 | { "gaussian5x1_sub_y", "gaussian_pyramid.cl" }, |
Gian Marco Iodice | 578ab61 | 2017-06-23 09:34:33 +0100 | [diff] [blame] | 268 | { "gemm_accumulate_biases", "gemm.cl" }, |
Gian Marco | 36a0a46 | 2018-01-12 10:21:40 +0000 | [diff] [blame] | 269 | { "gemm_interleave4x4", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 270 | { "gemm_ma_f16", "gemm.cl" }, |
| 271 | { "gemm_ma_f32", "gemm.cl" }, |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 272 | { "gemm_mv", "gemv.cl" }, |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 273 | { "gemm_mv_quantized", "gemv.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 274 | { "gemm_mm_interleaved_transposed_f16", "gemm.cl" }, |
Vidhya Sudhan Loganathan | 38d93bd | 2018-11-20 15:38:13 +0000 | [diff] [blame] | 275 | { "gemm_mm_interleaved_transposed_f16_acc32", "gemm.cl" }, |
Gian Marco Iodice | bb36a8e | 2018-04-19 12:05:08 +0100 | [diff] [blame] | 276 | { "gemm_mm_interleaved_transposed_f16_bifrost", "gemm.cl" }, |
| 277 | { "gemm_mm_interleaved_transposed_f32", "gemm.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 278 | { "gemm_mm_interleaved_transposed_f32_bifrost", "gemm.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 279 | { "gemm_mm_floating_point", "gemm.cl" }, |
Gian Marco Iodice | fd68311 | 2018-04-17 09:52:44 +0100 | [diff] [blame] | 280 | { "gemm_mm_floating_point_f16_bifrost", "gemm.cl" }, |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 281 | { "gemm_mm_floating_point_f16_bifrost_acc32", "gemm.cl" }, |
Anton Lokhmotov | 3e80c7f | 2017-11-20 11:02:10 +0000 | [diff] [blame] | 282 | { "gemm_mm_floating_point_f32_bifrost", "gemm.cl" }, |
| 283 | { "gemm_mm_floating_point_f32_bifrost_1000", "gemm.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 284 | { "gemm_mm_reshaped_lhs_nt_rhs_t", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 285 | { "gemm_lc_vm_f32", "gemm.cl" }, |
Gian Marco | 36a0a46 | 2018-01-12 10:21:40 +0000 | [diff] [blame] | 286 | { "gemm_transpose1xW", "gemm.cl" }, |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 287 | { "gemm_reshape_lhs_matrix_nt", "gemm.cl" }, |
Gian Marco Iodice | 08ddd7b | 2018-12-19 10:01:18 +0000 | [diff] [blame] | 288 | { "gemm_reshape_lhs_matrix_t", "gemm.cl" }, |
Gian Marco Iodice | 3b0a265 | 2018-12-07 11:18:09 +0000 | [diff] [blame] | 289 | { "gemm_reshape_rhs_matrix_nt", "gemm.cl" }, |
| 290 | { "gemm_reshape_rhs_matrix_t", "gemm.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 291 | { "gemmlowp_matrix_a_reduction", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 292 | { "gemmlowp_matrix_a_reduction_dot8", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 293 | { "gemmlowp_matrix_b_reduction", "gemmlowp.cl" }, |
Gian Marco | 7b4d547 | 2018-01-10 15:56:30 +0000 | [diff] [blame] | 294 | { "gemmlowp_mm_bifrost", "gemmlowp.cl" }, |
Giorgio Arena | 6200fa4 | 2018-07-06 17:06:36 +0100 | [diff] [blame] | 295 | { "gemmlowp_mm_bifrost_dot8", "gemmlowp.cl" }, |
Gian Marco | 7b4d547 | 2018-01-10 15:56:30 +0000 | [diff] [blame] | 296 | { "gemmlowp_mm_midgard", "gemmlowp.cl" }, |
Gian Marco | 19835e5 | 2018-01-30 13:35:54 +0000 | [diff] [blame] | 297 | { "gemmlowp_mm_interleaved_transposed_bifrost", "gemmlowp.cl" }, |
Giorgio Arena | 6200fa4 | 2018-07-06 17:06:36 +0100 | [diff] [blame] | 298 | { "gemmlowp_mm_interleaved_transposed_bifrost_dot8", "gemmlowp.cl" }, |
Gian Marco | 19835e5 | 2018-01-30 13:35:54 +0000 | [diff] [blame] | 299 | { "gemmlowp_mm_interleaved_transposed_midgard", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 300 | { "gemmlowp_offset_contribution", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 301 | { "gemmlowp_offset_contribution_quantize_down", "gemmlowp.cl" }, |
| 302 | { "gemmlowp_offset_contribution_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 303 | { "gemmlowp_output_stage_quantize_down", "gemmlowp.cl" }, |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 304 | { "gemmlowp_output_stage_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Georgios Pinitas | 51e53a3 | 2018-10-22 13:49:08 +0100 | [diff] [blame] | 305 | { "gemmlowp_output_stage_quantize_down_float", "gemmlowp.cl" }, |
giuros01 | cd96a26 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 306 | { "generate_proposals_compute_all_anchors", "generate_proposals.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 307 | { "harris_score_3x3", "harris_corners.cl" }, |
| 308 | { "harris_score_5x5", "harris_corners.cl" }, |
| 309 | { "harris_score_7x7", "harris_corners.cl" }, |
| 310 | { "hist_border_kernel", "histogram.cl" }, |
| 311 | { "hist_border_kernel_fixed", "histogram.cl" }, |
| 312 | { "hist_local_kernel", "histogram.cl" }, |
| 313 | { "hist_local_kernel_fixed", "histogram.cl" }, |
| 314 | { "hog_block_normalization", "hog.cl" }, |
| 315 | { "hog_detector", "hog.cl" }, |
| 316 | { "hog_orientation_binning", "hog.cl" }, |
| 317 | { "hysteresis", "canny.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 318 | { "im2col1x1_stridex1_nchw", "im2col.cl" }, |
| 319 | { "im2col3x3_nchw", "im2col.cl" }, |
| 320 | { "im2col5x5_nchw", "im2col.cl" }, |
| 321 | { "im2col11x11_padx0_pady0_nchw", "im2col.cl" }, |
| 322 | { "im2col_generic_nchw", "im2col.cl" }, |
| 323 | { "im2col_generic_padx0_pady0_nchw", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 324 | { "im2col3x3_nhwc", "im2col.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 325 | { "im2col9x9_nhwc", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 326 | { "im2col_generic_nhwc", "im2col.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 327 | { "init_level", "optical_flow_pyramid_lk.cl" }, |
| 328 | { "init_level_max", "optical_flow_pyramid_lk.cl" }, |
| 329 | { "init_level_max_initial_estimate", "optical_flow_pyramid_lk.cl" }, |
| 330 | { "integral_horizontal", "integral_image.cl" }, |
| 331 | { "integral_vertical", "integral_image.cl" }, |
| 332 | { "IYUV_to_NV12_bt709", "color_convert.cl" }, |
| 333 | { "IYUV_to_RGB888_bt709", "color_convert.cl" }, |
| 334 | { "IYUV_to_RGBA8888_bt709", "color_convert.cl" }, |
| 335 | { "IYUV_to_YUV444_bt709", "color_convert.cl" }, |
Michalis Spyrou | 5538d34 | 2018-11-14 08:10:13 +0000 | [diff] [blame] | 336 | { "l2_normalize_x", "l2_normalize.cl" }, |
| 337 | { "l2_normalize_y", "l2_normalize.cl" }, |
| 338 | { "l2_normalize_z", "l2_normalize.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 339 | { "lktracker_stage0", "optical_flow_pyramid_lk.cl" }, |
| 340 | { "lktracker_stage1", "optical_flow_pyramid_lk.cl" }, |
| 341 | { "magnitude_phase", "magnitude_phase.cl" }, |
| 342 | { "mean_stddev_accumulate", "mean_stddev.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 343 | { "memset", "memset.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 344 | { "minmax", "minmaxloc.cl" }, |
| 345 | { "minmax_border", "minmaxloc.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 346 | { "minmax_layer", "minmax_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 347 | { "minmaxloc", "minmaxloc.cl" }, |
| 348 | { "non_linear_filter_box3x3", "non_linear_filter3x3.cl" }, |
| 349 | { "non_linear_filter_cross3x3", "non_linear_filter3x3.cl" }, |
| 350 | { "non_linear_filter_disk3x3", "non_linear_filter3x3.cl" }, |
| 351 | { "non_linear_filter_box5x5", "non_linear_filter5x5.cl" }, |
| 352 | { "non_linear_filter_cross5x5", "non_linear_filter5x5.cl" }, |
| 353 | { "non_linear_filter_disk5x5", "non_linear_filter5x5.cl" }, |
| 354 | { "non_max_suppression", "nonmax.cl" }, |
| 355 | { "normalization_layer_cross_map", "normalization_layer.cl" }, |
Michele Di Giorgio | 9d3a831 | 2018-11-20 12:31:24 +0000 | [diff] [blame] | 356 | { "normalization_layer_in_map_nchw", "normalization_layer.cl" }, |
| 357 | { "normalization_layer_in_map_nhwc", "normalization_layer.cl" }, |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 358 | { "normalize_planar_yuv_layer_nchw", "normalize_planar_yuv_layer.cl" }, |
| 359 | { "normalize_planar_yuv_layer_nhwc", "normalize_planar_yuv_layer.cl" }, |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 360 | { "normalize_planar_yuv_layer_q8_nchw", "normalize_planar_yuv_layer_quantized.cl" }, |
| 361 | { "normalize_planar_yuv_layer_q8_nhwc", "normalize_planar_yuv_layer_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 362 | { "NV12_to_IYUV_bt709", "color_convert.cl" }, |
| 363 | { "NV12_to_RGB888_bt709", "color_convert.cl" }, |
| 364 | { "NV12_to_RGBA8888_bt709", "color_convert.cl" }, |
| 365 | { "NV12_to_YUV444_bt709", "color_convert.cl" }, |
| 366 | { "NV21_to_IYUV_bt709", "color_convert.cl" }, |
| 367 | { "NV21_to_RGB888_bt709", "color_convert.cl" }, |
| 368 | { "NV21_to_RGBA8888_bt709", "color_convert.cl" }, |
| 369 | { "NV21_to_YUV444_bt709", "color_convert.cl" }, |
Giorgio Arena | a086a0a | 2018-02-16 12:42:16 +0000 | [diff] [blame] | 370 | { "output_stage_quantized", "direct_convolution_1x1_3x3_5x5_quantized.cl" }, |
shubham | e1a4e37 | 2019-01-07 21:37:55 +0530 | [diff] [blame] | 371 | { "permute", "permute.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 372 | { "pixelwise_mul_float", "pixelwise_mul_float.cl" }, |
| 373 | { "pixelwise_mul_int", "pixelwise_mul_int.cl" }, |
Georgios Pinitas | bf28a3c | 2018-09-18 14:34:48 +0100 | [diff] [blame] | 374 | { "pixelwise_mul_quantized", "pixelwise_mul_int.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 375 | { "pooling_layer_2", "pooling_layer.cl" }, |
| 376 | { "pooling_layer_3", "pooling_layer.cl" }, |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 377 | { "pooling_layer_optimized_3", "pooling_layer.cl" }, |
Georgios Pinitas | ce09314 | 2017-06-19 16:11:53 +0100 | [diff] [blame] | 378 | { "pooling_layer_7", "pooling_layer.cl" }, |
Michalis Spyrou | e74b201 | 2018-04-18 09:49:16 +0100 | [diff] [blame] | 379 | { "pooling_layer_MxN_nchw", "pooling_layer.cl" }, |
| 380 | { "pooling_layer_MxN_nhwc", "pooling_layer.cl" }, |
| 381 | { "pooling_layer_MxN_quantized_nhwc", "pooling_layer_quantized.cl" }, |
| 382 | { "pooling_layer_MxN_quantized_nchw", "pooling_layer_quantized.cl" }, |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 383 | { "prior_box_layer_nchw", "prior_box_layer.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 384 | { "quantization_layer", "quantization_layer.cl" }, |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 385 | { "range", "range.cl" }, |
| 386 | { "range_quantized", "range.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 387 | { "reduction_operation_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7930db4 | 2018-11-22 17:36:28 +0000 | [diff] [blame] | 388 | { "reduction_operation_non_parallel_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 389 | { "reduction_operation_y", "reduction_operation.cl" }, |
| 390 | { "reduction_operation_z", "reduction_operation.cl" }, |
| 391 | { "reduction_operation_w", "reduction_operation.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 392 | { "remap_nearest_neighbour", "remap.cl" }, |
| 393 | { "remap_bilinear", "remap.cl" }, |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 394 | { "reorg_layer_nchw", "reorg_layer.cl" }, |
| 395 | { "reorg_layer_nhwc", "reorg_layer.cl" }, |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 396 | { "reshape_layer", "reshape_layer.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 397 | { "reshape_to_columns", "convolution_layer.cl" }, |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 398 | { "reverse", "reverse.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 399 | { "RGB888_to_IYUV_bt709", "color_convert.cl" }, |
| 400 | { "RGB888_to_NV12_bt709", "color_convert.cl" }, |
| 401 | { "RGB888_to_RGBA8888_bt709", "color_convert.cl" }, |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 402 | { "RGB888_to_U8_bt709", "color_convert.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 403 | { "RGB888_to_YUV444_bt709", "color_convert.cl" }, |
| 404 | { "RGBA8888_to_IYUV_bt709", "color_convert.cl" }, |
| 405 | { "RGBA8888_to_NV12_bt709", "color_convert.cl" }, |
| 406 | { "RGBA8888_to_RGB888_bt709", "color_convert.cl" }, |
| 407 | { "RGBA8888_to_YUV444_bt709", "color_convert.cl" }, |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 408 | { "roi_align_layer", "roi_align_layer.cl" }, |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 409 | { "roi_pooling_layer", "roi_pooling_layer.cl" }, |
Michalis Spyrou | 46da23f | 2018-04-10 13:41:30 +0100 | [diff] [blame] | 410 | { "scale_nearest_neighbour_nchw", "scale.cl" }, |
| 411 | { "scale_nearest_neighbour_nhwc", "scale.cl" }, |
| 412 | { "scale_bilinear_nchw", "scale.cl" }, |
| 413 | { "scale_bilinear_nhwc", "scale.cl" }, |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 414 | { "scale_bilinear_quantized_nchw", "scale_quantized.cl" }, |
| 415 | { "scale_bilinear_quantized_nhwc", "scale_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 416 | { "scharr3x3", "scharr_filter.cl" }, |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 417 | { "select_same_rank", "select.cl" }, |
| 418 | { "select_different_rank_2", "select.cl" }, |
| 419 | { "select_different_rank_n", "select.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 420 | { "sobel3x3", "sobel_filter.cl" }, |
| 421 | { "sobel_separable5x1", "sobel_filter.cl" }, |
| 422 | { "sobel_separable1x5", "sobel_filter.cl" }, |
| 423 | { "sobel_separable7x1", "sobel_filter.cl" }, |
| 424 | { "sobel_separable1x7", "sobel_filter.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 425 | { "softmax_layer_norm", "softmax_layer.cl" }, |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 426 | { "softmax_layer_norm_quantized", "softmax_layer_quantized.cl" }, |
Giorgio Arena | 4402cb9 | 2018-02-15 13:37:40 +0000 | [diff] [blame] | 427 | { "softmax_layer_max_shift_exp_sum_quantized_serial", "softmax_layer_quantized.cl" }, |
| 428 | { "softmax_layer_max_shift_exp_sum_quantized_parallel", "softmax_layer_quantized.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 429 | { "softmax_layer_max_shift_exp_sum_serial", "softmax_layer.cl" }, |
Michalis Spyrou | 13a51e1 | 2018-09-18 13:09:30 +0100 | [diff] [blame] | 430 | { "space_to_batch_nchw", "space_to_batch.cl" }, |
| 431 | { "space_to_batch_static_nchw", "space_to_batch.cl" }, |
| 432 | { "space_to_batch_nhwc", "space_to_batch.cl" }, |
| 433 | { "space_to_batch_static_nhwc", "space_to_batch.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 434 | { "softmax_layer_max_shift_exp_sum_parallel", "softmax_layer.cl" }, |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 435 | { "stack_layer", "stack_layer.cl" }, |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 436 | { "strided_slice", "slice_ops.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 437 | { "suppress_non_maximum", "canny.cl" }, |
| 438 | { "tablelookup_U8", "tablelookup.cl" }, |
| 439 | { "tablelookup_S16", "tablelookup.cl" }, |
| 440 | { "threshold_binary", "threshold.cl" }, |
| 441 | { "threshold_range", "threshold.cl" }, |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 442 | { "tile", "tile.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 443 | { "transpose", "transpose.cl" }, |
| 444 | { "UYVY422_to_IYUV_bt709", "color_convert.cl" }, |
| 445 | { "UYVY422_to_NV12_bt709", "color_convert.cl" }, |
| 446 | { "UYVY422_to_RGB888_bt709", "color_convert.cl" }, |
| 447 | { "UYVY422_to_RGBA8888_bt709", "color_convert.cl" }, |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 448 | { "upsample_layer_nchw", "upsample_layer.cl" }, |
| 449 | { "upsample_layer_nhwc", "upsample_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 450 | { "warp_affine_nearest_neighbour", "warp_affine.cl" }, |
| 451 | { "warp_affine_bilinear", "warp_affine.cl" }, |
| 452 | { "warp_perspective_nearest_neighbour", "warp_perspective.cl" }, |
| 453 | { "warp_perspective_bilinear", "warp_perspective.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 454 | { "winograd_filter_transform_2x2_3x3_nchw", "winograd_filter_transform.cl" }, |
| 455 | { "winograd_filter_transform_2x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 456 | { "winograd_filter_transform_1x2_1x3_nchw", "winograd_filter_transform.cl" }, |
| 457 | { "winograd_filter_transform_4x4_3x3_nchw", "winograd_filter_transform.cl" }, |
| 458 | { "winograd_filter_transform_4x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 459 | { "winograd_filter_transform_1x4_1x3_nchw", "winograd_filter_transform.cl" }, |
| 460 | { "winograd_filter_transform_4x4_5x5_nchw", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 461 | { "winograd_filter_transform_4x1_5x1_nchw", "winograd_filter_transform.cl" }, |
| 462 | { "winograd_filter_transform_1x4_1x5_nchw", "winograd_filter_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 463 | { "winograd_filter_transform_4x1_3x1_nhwc", "winograd_filter_transform.cl" }, |
| 464 | { "winograd_filter_transform_1x4_1x3_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 465 | { "winograd_filter_transform_4x4_3x3_nhwc", "winograd_filter_transform.cl" }, |
| 466 | { "winograd_filter_transform_4x4_5x5_nhwc", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 467 | { "winograd_filter_transform_4x1_5x1_nhwc", "winograd_filter_transform.cl" }, |
| 468 | { "winograd_filter_transform_1x4_1x5_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 469 | { "winograd_input_transform_2x2_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 470 | { "winograd_input_transform_2x2_3x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 471 | { "winograd_input_transform_2x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 472 | { "winograd_input_transform_2x1_3x1_stepz2_nchw", "winograd_input_transform.cl" }, |
| 473 | { "winograd_input_transform_1x2_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 474 | { "winograd_input_transform_1x2_1x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 475 | { "winograd_input_transform_4x4_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 476 | { "winograd_input_transform_4x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 477 | { "winograd_input_transform_1x4_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 478 | { "winograd_input_transform_4x4_5x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 479 | { "winograd_input_transform_4x1_5x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 480 | { "winograd_input_transform_1x4_1x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 481 | { "winograd_input_transform_4x1_3x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 482 | { "winograd_input_transform_1x4_1x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 483 | { "winograd_input_transform_4x4_3x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 484 | { "winograd_input_transform_4x4_5x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 485 | { "winograd_input_transform_4x1_5x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 486 | { "winograd_input_transform_1x4_1x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 487 | { "winograd_output_transform_2x2_3x3_nchw", "winograd_output_transform.cl" }, |
| 488 | { "winograd_output_transform_2x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 489 | { "winograd_output_transform_1x2_1x3_nchw", "winograd_output_transform.cl" }, |
| 490 | { "winograd_output_transform_4x4_3x3_nchw", "winograd_output_transform.cl" }, |
| 491 | { "winograd_output_transform_4x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 492 | { "winograd_output_transform_1x4_1x3_nchw", "winograd_output_transform.cl" }, |
| 493 | { "winograd_output_transform_4x4_5x5_nchw", "winograd_output_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 494 | { "winograd_output_transform_4x1_5x1_nchw", "winograd_output_transform.cl" }, |
| 495 | { "winograd_output_transform_1x4_1x5_nchw", "winograd_output_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 496 | { "winograd_output_transform_4x1_3x1_nhwc", "winograd_output_transform.cl" }, |
| 497 | { "winograd_output_transform_1x4_1x3_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 498 | { "winograd_output_transform_4x4_3x3_nhwc", "winograd_output_transform.cl" }, |
| 499 | { "winograd_output_transform_4x4_5x5_nhwc", "winograd_output_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 500 | { "winograd_output_transform_4x1_5x1_nhwc", "winograd_output_transform.cl" }, |
| 501 | { "winograd_output_transform_1x4_1x5_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 502 | { "yolo_layer_nchw", "yolo_layer.cl" }, |
| 503 | { "yolo_layer_nhwc", "yolo_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 504 | { "YUYV422_to_IYUV_bt709", "color_convert.cl" }, |
| 505 | { "YUYV422_to_NV12_bt709", "color_convert.cl" }, |
| 506 | { "YUYV422_to_RGB888_bt709", "color_convert.cl" }, |
| 507 | { "YUYV422_to_RGBA8888_bt709", "color_convert.cl" }, |
| 508 | }; |
| 509 | |
| 510 | const std::map<std::string, std::string> CLKernelLibrary::_program_source_map = |
| 511 | { |
| 512 | #ifdef EMBEDDED_KERNELS |
| 513 | { |
| 514 | "absdiff.cl", |
| 515 | #include "./cl_kernels/absdiff.clembed" |
| 516 | }, |
| 517 | { |
| 518 | "accumulate.cl", |
| 519 | #include "./cl_kernels/accumulate.clembed" |
| 520 | }, |
| 521 | { |
| 522 | "activation_layer.cl", |
| 523 | #include "./cl_kernels/activation_layer.clembed" |
| 524 | }, |
| 525 | { |
Michel Iwaniec | 0063380 | 2017-10-12 14:14:15 +0100 | [diff] [blame] | 526 | "activation_layer_qa8.cl", |
| 527 | #include "./cl_kernels/activation_layer_qa8.clembed" |
| 528 | }, |
| 529 | { |
Michalis Spyrou | 6a8d3b6 | 2018-08-31 10:07:09 +0100 | [diff] [blame] | 530 | "batch_to_space.cl", |
| 531 | #include "./cl_kernels/batch_to_space.clembed" |
| 532 | }, |
| 533 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 534 | "bitwise_op.cl", |
| 535 | #include "./cl_kernels/bitwise_op.clembed" |
| 536 | }, |
| 537 | { |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 538 | "bounding_box_transform.cl", |
| 539 | #include "./cl_kernels/bounding_box_transform.clembed" |
| 540 | }, |
| 541 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 542 | "canny.cl", |
| 543 | #include "./cl_kernels/canny.clembed" |
| 544 | }, |
| 545 | { |
| 546 | "channel_combine.cl", |
| 547 | #include "./cl_kernels/channel_combine.clembed" |
| 548 | }, |
| 549 | { |
| 550 | "channel_extract.cl", |
| 551 | #include "./cl_kernels/channel_extract.clembed" |
| 552 | }, |
| 553 | { |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 554 | "channel_shuffle.cl", |
| 555 | #include "./cl_kernels/channel_shuffle.clembed" |
| 556 | }, |
| 557 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 558 | "col2im.cl", |
| 559 | #include "./cl_kernels/col2im.clembed" |
| 560 | }, |
| 561 | { |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 562 | "comparisons.cl", |
| 563 | #include "./cl_kernels/comparisons.clembed" |
| 564 | }, |
| 565 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 566 | "concatenate.cl", |
| 567 | #include "./cl_kernels/concatenate.clembed" |
| 568 | }, |
| 569 | { |
| 570 | "color_convert.cl", |
| 571 | #include "./cl_kernels/color_convert.clembed" |
| 572 | }, |
| 573 | { |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 574 | "convert_fc_weights.cl", |
| 575 | #include "./cl_kernels/convert_fc_weights.clembed" |
| 576 | }, |
| 577 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 578 | "convolution3x3.cl", |
| 579 | #include "./cl_kernels/convolution3x3.clembed" |
| 580 | }, |
| 581 | { |
| 582 | "convolution5x5.cl", |
| 583 | #include "./cl_kernels/convolution5x5.clembed" |
| 584 | }, |
| 585 | { |
| 586 | "convolution7x7.cl", |
| 587 | #include "./cl_kernels/convolution7x7.clembed" |
| 588 | }, |
| 589 | { |
| 590 | "convolution9x9.cl", |
| 591 | #include "./cl_kernels/convolution9x9.clembed" |
| 592 | }, |
| 593 | { |
| 594 | "convolution_layer.cl", |
| 595 | #include "./cl_kernels/convolution_layer.clembed" |
| 596 | }, |
| 597 | { |
| 598 | "convolution_rectangle.cl", |
| 599 | #include "./cl_kernels/convolution_rectangle.clembed" |
| 600 | }, |
| 601 | { |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 602 | "copy_tensor.cl", |
| 603 | #include "./cl_kernels/copy_tensor.clembed" |
| 604 | }, |
| 605 | { |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 606 | "upsample_layer.cl", |
| 607 | #include "./cl_kernels/upsample_layer.clembed" |
| 608 | }, |
| 609 | { |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 610 | "deconvolution_layer.cl", |
| 611 | #include "./cl_kernels/deconvolution_layer.clembed" |
| 612 | }, |
| 613 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 614 | "depth_convert.cl", |
| 615 | #include "./cl_kernels/depth_convert.clembed" |
| 616 | }, |
| 617 | { |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 618 | "depthwise_convolution.cl", |
| 619 | #include "./cl_kernels/depthwise_convolution.clembed" |
| 620 | }, |
| 621 | { |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 622 | "depthwise_convolution_quantized.cl", |
| 623 | #include "./cl_kernels/depthwise_convolution_quantized.clembed" |
| 624 | }, |
| 625 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 626 | "dequantization_layer.cl", |
| 627 | #include "./cl_kernels/dequantization_layer.clembed" |
| 628 | }, |
| 629 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 630 | "derivative.cl", |
| 631 | #include "./cl_kernels/derivative.clembed" |
| 632 | }, |
| 633 | { |
| 634 | "dilate.cl", |
| 635 | #include "./cl_kernels/dilate.clembed" |
| 636 | }, |
| 637 | { |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 638 | "direct_convolution1x1.cl", |
| 639 | #include "./cl_kernels/direct_convolution1x1.clembed" |
| 640 | }, |
| 641 | { |
| 642 | "direct_convolution3x3.cl", |
| 643 | #include "./cl_kernels/direct_convolution3x3.clembed" |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 644 | }, |
| 645 | { |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 646 | "direct_convolution5x5.cl", |
| 647 | #include "./cl_kernels/direct_convolution5x5.clembed" |
| 648 | }, |
| 649 | { |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 650 | "direct_convolution_1x1_3x3_5x5_quantized.cl", |
| 651 | #include "./cl_kernels/direct_convolution_1x1_3x3_5x5_quantized.clembed" |
| 652 | }, |
| 653 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 654 | "elementwise_operation.cl", |
| 655 | #include "./cl_kernels/elementwise_operation.clembed" |
| 656 | }, |
| 657 | { |
| 658 | "elementwise_operation_quantized.cl", |
| 659 | #include "./cl_kernels/elementwise_operation_quantized.clembed" |
| 660 | }, |
| 661 | { |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 662 | "elementwise_unary.cl", |
| 663 | #include "./cl_kernels/elementwise_unary.clembed" |
| 664 | }, |
| 665 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 666 | "erode.cl", |
| 667 | #include "./cl_kernels/erode.clembed" |
| 668 | }, |
| 669 | { |
| 670 | "fast_corners.cl", |
| 671 | #include "./cl_kernels/fast_corners.clembed" |
| 672 | }, |
| 673 | { |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 674 | "flatten.cl", |
| 675 | #include "./cl_kernels/flatten.clembed" |
| 676 | }, |
| 677 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 678 | "fill_border.cl", |
| 679 | #include "./cl_kernels/fill_border.clembed" |
| 680 | }, |
| 681 | { |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 682 | "floor.cl", |
| 683 | #include "./cl_kernels/floor.clembed" |
| 684 | }, |
| 685 | { |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 686 | "gather.cl", |
| 687 | #include "./cl_kernels/gather.clembed" |
| 688 | }, |
| 689 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 690 | "gaussian_pyramid.cl", |
| 691 | #include "./cl_kernels/gaussian_pyramid.clembed" |
| 692 | }, |
| 693 | { |
| 694 | "gemm.cl", |
| 695 | #include "./cl_kernels/gemm.clembed" |
| 696 | }, |
| 697 | { |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 698 | "gemmlowp.cl", |
| 699 | #include "./cl_kernels/gemmlowp.clembed" |
| 700 | }, |
| 701 | { |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 702 | "gemv.cl", |
| 703 | #include "./cl_kernels/gemv.clembed" |
| 704 | }, |
| 705 | { |
giuros01 | cd96a26 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 706 | "generate_proposals.cl", |
| 707 | #include "./cl_kernels/generate_proposals.clembed" |
| 708 | }, |
| 709 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 710 | "harris_corners.cl", |
| 711 | #include "./cl_kernels/harris_corners.clembed" |
| 712 | }, |
| 713 | { |
| 714 | "helpers.h", |
| 715 | #include "./cl_kernels/helpers.hembed" |
| 716 | }, |
| 717 | { |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 718 | "helpers_asymm.h", |
| 719 | #include "./cl_kernels/helpers_asymm.hembed" |
| 720 | }, |
| 721 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 722 | "histogram.cl", |
| 723 | #include "./cl_kernels/histogram.clembed" |
| 724 | }, |
| 725 | { |
| 726 | "hog.cl", |
| 727 | #include "./cl_kernels/hog.clembed" |
| 728 | }, |
| 729 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 730 | "im2col.cl", |
| 731 | #include "./cl_kernels/im2col.clembed" |
| 732 | }, |
| 733 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 734 | "integral_image.cl", |
| 735 | #include "./cl_kernels/integral_image.clembed" |
| 736 | }, |
| 737 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 738 | "l2_normalize.cl", |
| 739 | #include "./cl_kernels/l2_normalize.clembed" |
| 740 | }, |
| 741 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 742 | "magnitude_phase.cl", |
| 743 | #include "./cl_kernels/magnitude_phase.clembed" |
| 744 | }, |
| 745 | { |
| 746 | "mean_stddev.cl", |
| 747 | #include "./cl_kernels/mean_stddev.clembed" |
| 748 | }, |
| 749 | { |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 750 | "memset.cl", |
| 751 | #include "./cl_kernels/memset.clembed" |
| 752 | }, |
| 753 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 754 | "minmaxloc.cl", |
| 755 | #include "./cl_kernels/minmaxloc.clembed" |
| 756 | }, |
| 757 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 758 | "minmax_layer.cl", |
| 759 | #include "./cl_kernels/minmax_layer.clembed" |
| 760 | }, |
| 761 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 762 | "non_linear_filter3x3.cl", |
| 763 | #include "./cl_kernels/non_linear_filter3x3.clembed" |
| 764 | }, |
| 765 | { |
| 766 | "non_linear_filter5x5.cl", |
| 767 | #include "./cl_kernels/non_linear_filter5x5.clembed" |
| 768 | }, |
| 769 | { |
| 770 | "non_linear_filter_helpers.h", |
| 771 | #include "./cl_kernels/non_linear_filter_helpers.hembed" |
| 772 | }, |
| 773 | { |
| 774 | "nonmax.cl", |
| 775 | #include "./cl_kernels/nonmax.clembed" |
| 776 | }, |
| 777 | { |
| 778 | "normalization_layer.cl", |
| 779 | #include "./cl_kernels/normalization_layer.clembed" |
| 780 | }, |
| 781 | { |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 782 | "normalize_planar_yuv_layer.cl", |
| 783 | #include "./cl_kernels/normalize_planar_yuv_layer.clembed" |
| 784 | }, |
| 785 | { |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 786 | "normalize_planar_yuv_layer_quantized.cl", |
| 787 | #include "./cl_kernels/normalize_planar_yuv_layer_quantized.clembed" |
| 788 | }, |
| 789 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 790 | "batchnormalization_layer.cl", |
| 791 | #include "./cl_kernels/batchnormalization_layer.clembed" |
| 792 | }, |
| 793 | { |
| 794 | "optical_flow_pyramid_lk.cl", |
| 795 | #include "./cl_kernels/optical_flow_pyramid_lk.clembed" |
| 796 | }, |
| 797 | { |
Michalis Spyrou | 5237e01 | 2018-01-17 09:40:27 +0000 | [diff] [blame] | 798 | "permute.cl", |
| 799 | #include "./cl_kernels/permute.clembed" |
| 800 | }, |
| 801 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 802 | "pixelwise_mul_float.cl", |
| 803 | #include "./cl_kernels/pixelwise_mul_float.clembed" |
| 804 | }, |
| 805 | { |
| 806 | "pixelwise_mul_int.cl", |
| 807 | #include "./cl_kernels/pixelwise_mul_int.clembed" |
| 808 | }, |
| 809 | { |
| 810 | "pooling_layer.cl", |
| 811 | #include "./cl_kernels/pooling_layer.clembed" |
| 812 | }, |
| 813 | { |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 814 | "pooling_layer_quantized.cl", |
| 815 | #include "./cl_kernels/pooling_layer_quantized.clembed" |
| 816 | }, |
| 817 | { |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 818 | "prior_box_layer.cl", |
| 819 | #include "./cl_kernels/prior_box_layer.clembed" |
| 820 | }, |
| 821 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 822 | "quantization_layer.cl", |
| 823 | #include "./cl_kernels/quantization_layer.clembed" |
| 824 | }, |
| 825 | { |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 826 | "range.cl", |
| 827 | #include "./cl_kernels/range.clembed" |
| 828 | }, |
| 829 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 830 | "reduction_operation.cl", |
| 831 | #include "./cl_kernels/reduction_operation.clembed" |
| 832 | }, |
| 833 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 834 | "remap.cl", |
| 835 | #include "./cl_kernels/remap.clembed" |
| 836 | }, |
| 837 | { |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 838 | "reorg_layer.cl", |
| 839 | #include "./cl_kernels/reorg_layer.clembed" |
| 840 | }, |
| 841 | { |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 842 | "reshape_layer.cl", |
| 843 | #include "./cl_kernels/reshape_layer.clembed" |
| 844 | }, |
| 845 | { |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 846 | "reverse.cl", |
| 847 | #include "./cl_kernels/reverse.clembed" |
| 848 | }, |
| 849 | { |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 850 | "roi_align_layer.cl", |
| 851 | #include "./cl_kernels/roi_align_layer.clembed" |
| 852 | }, |
| 853 | { |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 854 | "roi_pooling_layer.cl", |
| 855 | #include "./cl_kernels/roi_pooling_layer.clembed" |
| 856 | }, |
| 857 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 858 | "scale.cl", |
| 859 | #include "./cl_kernels/scale.clembed" |
| 860 | }, |
| 861 | { |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 862 | "scale_quantized.cl", |
| 863 | #include "./cl_kernels/scale_quantized.clembed" |
| 864 | }, |
| 865 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 866 | "scharr_filter.cl", |
| 867 | #include "./cl_kernels/scharr_filter.clembed" |
| 868 | }, |
| 869 | { |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 870 | "select.cl", |
| 871 | #include "./cl_kernels/select.clembed" |
| 872 | }, |
| 873 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 874 | "sobel_filter.cl", |
| 875 | #include "./cl_kernels/sobel_filter.clembed" |
| 876 | }, |
| 877 | { |
| 878 | "softmax_layer.cl", |
| 879 | #include "./cl_kernels/softmax_layer.clembed" |
| 880 | }, |
| 881 | { |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 882 | "softmax_layer_quantized.cl", |
| 883 | #include "./cl_kernels/softmax_layer_quantized.clembed" |
| 884 | }, |
| 885 | { |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 886 | "slice_ops.cl", |
| 887 | #include "./cl_kernels/slice_ops.clembed" |
Georgios Pinitas | 77589b5 | 2018-08-21 14:41:35 +0100 | [diff] [blame] | 888 | }, |
| 889 | { |
Michalis Spyrou | 16934a5 | 2018-08-21 18:03:58 +0100 | [diff] [blame] | 890 | "space_to_batch.cl", |
| 891 | #include "./cl_kernels/space_to_batch.clembed" |
| 892 | }, |
| 893 | { |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 894 | "stack_layer.cl", |
| 895 | #include "./cl_kernels/stack_layer.clembed" |
| 896 | }, |
| 897 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 898 | "tablelookup.cl", |
| 899 | #include "./cl_kernels/tablelookup.clembed" |
| 900 | }, |
| 901 | { |
| 902 | "threshold.cl", |
| 903 | #include "./cl_kernels/threshold.clembed" |
| 904 | }, |
| 905 | { |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 906 | "tile.cl", |
| 907 | #include "./cl_kernels/tile.clembed" |
| 908 | }, |
| 909 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 910 | "transpose.cl", |
| 911 | #include "./cl_kernels/transpose.clembed" |
| 912 | }, |
| 913 | { |
| 914 | "types.h", |
| 915 | #include "./cl_kernels/types.hembed" |
| 916 | }, |
| 917 | { |
| 918 | "warp_affine.cl", |
| 919 | #include "./cl_kernels/warp_affine.clembed" |
| 920 | }, |
| 921 | { |
| 922 | "warp_helpers.h", |
| 923 | #include "./cl_kernels/warp_helpers.hembed" |
| 924 | }, |
| 925 | { |
| 926 | "warp_perspective.cl", |
| 927 | #include "./cl_kernels/warp_perspective.clembed" |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 928 | }, |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 929 | { |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 930 | "winograd_filter_transform.cl", |
| 931 | #include "./cl_kernels/winograd_filter_transform.clembed" |
| 932 | }, |
| 933 | { |
| 934 | "winograd_input_transform.cl", |
| 935 | #include "./cl_kernels/winograd_input_transform.clembed" |
| 936 | }, |
| 937 | { |
| 938 | "winograd_output_transform.cl", |
| 939 | #include "./cl_kernels/winograd_output_transform.clembed" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 940 | }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 941 | { |
| 942 | "yolo_layer.cl", |
| 943 | #include "./cl_kernels/yolo_layer.clembed" |
| 944 | }, |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 945 | #endif /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 946 | }; |
| 947 | |
| 948 | CLKernelLibrary::CLKernelLibrary() |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 949 | : _context(), _device(), _kernel_path("."), _programs_map(), _built_programs_map() |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 950 | { |
Anthony Barbier | ecb1c62 | 2018-04-17 11:45:10 +0100 | [diff] [blame] | 951 | 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] | 952 | } |
| 953 | |
| 954 | CLKernelLibrary &CLKernelLibrary::get() |
| 955 | { |
| 956 | static CLKernelLibrary _kernel_library; |
| 957 | return _kernel_library; |
| 958 | } |
| 959 | |
| 960 | Kernel CLKernelLibrary::create_kernel(const std::string &kernel_name, const StringSet &build_options_set) const |
| 961 | { |
| 962 | // Find which program contains the kernel |
| 963 | auto kernel_program_it = _kernel_program_map.find(kernel_name); |
| 964 | |
| 965 | if(_kernel_program_map.end() == kernel_program_it) |
| 966 | { |
| 967 | ARM_COMPUTE_ERROR("Kernel %s not found in the CLKernelLibrary", kernel_name.c_str()); |
| 968 | } |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 969 | std::string concat_str; |
| 970 | |
Georgios Pinitas | df473ea | 2018-05-31 18:53:52 +0100 | [diff] [blame] | 971 | #if defined(ARM_COMPUTE_DEBUG_ENABLED) |
| 972 | // Enable debug properties in CL kernels |
| 973 | concat_str += " -DARM_COMPUTE_DEBUG_ENABLED"; |
| 974 | #endif // defined(ARM_COMPUTE_DEBUG_ENABLED) |
| 975 | |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 976 | if(fp16_supported()) |
Matthew Bentham | 6f31f8c | 2017-10-27 11:50:06 +0100 | [diff] [blame] | 977 | { |
| 978 | concat_str += " -DARM_COMPUTE_OPENCL_FP16_ENABLED=1 "; |
| 979 | } |
| 980 | |
Michalis Spyrou | e03342e | 2018-01-15 14:39:13 +0000 | [diff] [blame] | 981 | if(dot8_supported(_device)) |
| 982 | { |
| 983 | concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ENABLED=1 "; |
| 984 | } |
| 985 | |
Giorgio Arena | eff8d95 | 2018-07-02 15:29:57 +0100 | [diff] [blame] | 986 | if(dot8_acc_supported(_device)) |
| 987 | { |
| 988 | concat_str += " -DARM_COMPUTE_OPENCL_DOT8_ACC_ENABLED=1 "; |
| 989 | } |
| 990 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 991 | if(get_cl_version(_device) == CLVersion::CL20) |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 992 | { |
| 993 | concat_str += " -cl-std=CL2.0 "; |
| 994 | } |
Anthony Barbier | d727e85 | 2018-04-20 11:05:29 +0100 | [diff] [blame] | 995 | else if(arm_non_uniform_workgroup_supported(_device)) |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 996 | { |
| 997 | concat_str += " -cl-arm-non-uniform-work-group-size "; |
| 998 | } |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 999 | else |
| 1000 | { |
| 1001 | ARM_COMPUTE_ERROR("Non uniform workgroup size is not supported!!"); |
| 1002 | } |
| 1003 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1004 | // Check if the program has been built before with same build options. |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1005 | const std::string program_name = kernel_program_it->second; |
| 1006 | const std::string build_options = stringify_set(build_options_set) + concat_str; |
| 1007 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1008 | const std::string built_program_name = program_name + "_" + build_options; |
| 1009 | auto built_program_it = _built_programs_map.find(built_program_name); |
| 1010 | |
| 1011 | cl::Program cl_program; |
| 1012 | |
| 1013 | if(_built_programs_map.end() != built_program_it) |
| 1014 | { |
| 1015 | // If program has been built, retrieve to create kernel from it |
| 1016 | cl_program = built_program_it->second; |
| 1017 | } |
| 1018 | else |
| 1019 | { |
| 1020 | // Get program |
| 1021 | Program program = load_program(program_name); |
| 1022 | |
| 1023 | // Build program |
| 1024 | cl_program = program.build(build_options); |
| 1025 | |
| 1026 | // Add built program to internal map |
| 1027 | _built_programs_map.emplace(built_program_name, cl_program); |
| 1028 | } |
| 1029 | |
| 1030 | // Create and return kernel |
| 1031 | return Kernel(kernel_name, cl_program); |
| 1032 | } |
| 1033 | |
Anthony Barbier | 7da55aa | 2018-04-13 16:58:43 +0100 | [diff] [blame] | 1034 | void CLKernelLibrary::add_built_program(const std::string &built_program_name, cl::Program program) |
| 1035 | { |
| 1036 | _built_programs_map.emplace(built_program_name, program); |
| 1037 | } |
| 1038 | |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 1039 | bool CLKernelLibrary::fp16_supported() const |
| 1040 | { |
| 1041 | return ::fp16_supported(_device); |
| 1042 | } |
| 1043 | |
Vidhya Sudhan Loganathan | 76c8564 | 2018-05-25 13:53:02 +0100 | [diff] [blame] | 1044 | bool CLKernelLibrary::int64_base_atomics_supported() const |
| 1045 | { |
| 1046 | return device_supports_extension(_device, "cl_khr_int64_base_atomics"); |
| 1047 | } |
| 1048 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1049 | const Program &CLKernelLibrary::load_program(const std::string &program_name) const |
| 1050 | { |
| 1051 | const auto program_it = _programs_map.find(program_name); |
| 1052 | |
| 1053 | if(program_it != _programs_map.end()) |
| 1054 | { |
| 1055 | return program_it->second; |
| 1056 | } |
| 1057 | |
| 1058 | Program program; |
| 1059 | |
| 1060 | #ifdef EMBEDDED_KERNELS |
| 1061 | const auto program_source_it = _program_source_map.find(program_name); |
| 1062 | |
| 1063 | if(_program_source_map.end() == program_source_it) |
| 1064 | { |
| 1065 | ARM_COMPUTE_ERROR("Embedded program for %s does not exist.", program_name.c_str()); |
| 1066 | } |
| 1067 | |
| 1068 | program = Program(_context, program_name, program_source_it->second); |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 1069 | #else /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1070 | // Check for binary |
| 1071 | std::string source_name = _kernel_path + program_name; |
| 1072 | std::string binary_name = source_name + "bin"; |
| 1073 | |
| 1074 | if(std::ifstream(binary_name).is_open()) |
| 1075 | { |
| 1076 | const std::string program_binary = read_file(binary_name, true); |
| 1077 | program = Program(_context, _device, program_name, std::vector<unsigned char>(program_binary.begin(), program_binary.end())); |
| 1078 | } |
| 1079 | else if(std::ifstream(source_name).is_open()) |
| 1080 | { |
| 1081 | program = Program(_context, program_name, read_file(source_name, false)); |
| 1082 | } |
| 1083 | else |
| 1084 | { |
| 1085 | ARM_COMPUTE_ERROR("Kernel file %s does not exist.", source_name.c_str()); |
| 1086 | } |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 1087 | #endif /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1088 | |
| 1089 | // Insert program to program map |
| 1090 | const auto new_program = _programs_map.emplace(program_name, std::move(program)); |
| 1091 | |
| 1092 | return new_program.first->second; |
| 1093 | } |
| 1094 | |
| 1095 | std::string CLKernelLibrary::stringify_set(const StringSet &s) const |
| 1096 | { |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 1097 | std::string concat_set; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1098 | |
| 1099 | #ifndef EMBEDDED_KERNELS |
| 1100 | concat_set += "-I" + _kernel_path + " "; |
| 1101 | #endif /* EMBEDDED_KERNELS */ |
| 1102 | |
| 1103 | // Concatenate set |
| 1104 | for(const auto &el : s) |
| 1105 | { |
| 1106 | concat_set += " " + el; |
| 1107 | } |
| 1108 | |
| 1109 | return concat_set; |
| 1110 | } |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1111 | |
| 1112 | std::string CLKernelLibrary::get_program_source(const std::string &program_name) |
| 1113 | { |
| 1114 | const auto program_source_it = _program_source_map.find(program_name); |
| 1115 | |
| 1116 | if(program_source_it == _program_source_map.end()) |
| 1117 | { |
| 1118 | ARM_COMPUTE_ERROR("Embedded program for %s does not exist.", program_name.c_str()); |
| 1119 | } |
| 1120 | |
| 1121 | return program_source_it->second; |
| 1122 | } |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1123 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1124 | size_t CLKernelLibrary::max_local_workgroup_size(const cl::Kernel &kernel) const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1125 | { |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1126 | size_t result; |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1127 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1128 | size_t err = kernel.getWorkGroupInfo(_device, CL_KERNEL_WORK_GROUP_SIZE, &result); |
| 1129 | ARM_COMPUTE_ERROR_ON_MSG(err != 0, "clGetKernelWorkGroupInfo failed to return the maximum workgroup size for the kernel"); |
| 1130 | ARM_COMPUTE_UNUSED(err); |
| 1131 | |
| 1132 | return result; |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1133 | } |
| 1134 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1135 | cl::NDRange CLKernelLibrary::default_ndrange() const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1136 | { |
Anthony Barbier | b6eb353 | 2018-08-08 13:20:04 +0100 | [diff] [blame] | 1137 | GPUTarget _target = get_target_from_device(_device); |
Michalis Spyrou | a967611 | 2018-02-22 18:07:43 +0000 | [diff] [blame] | 1138 | cl::NDRange default_range; |
| 1139 | |
| 1140 | switch(_target) |
| 1141 | { |
| 1142 | case GPUTarget::MIDGARD: |
| 1143 | case GPUTarget::T600: |
| 1144 | case GPUTarget::T700: |
| 1145 | case GPUTarget::T800: |
| 1146 | default_range = cl::NDRange(128u, 1); |
| 1147 | break; |
| 1148 | default: |
| 1149 | default_range = cl::NullRange; |
| 1150 | } |
| 1151 | |
| 1152 | return default_range; |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1153 | } |
Anthony Barbier | 847864d | 2018-03-07 11:35:53 +0000 | [diff] [blame] | 1154 | |
| 1155 | std::string CLKernelLibrary::get_device_version() |
| 1156 | { |
| 1157 | return _device.getInfo<CL_DEVICE_VERSION>(); |
| 1158 | } |