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