Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | b54ba28 | 2020-01-14 15:31:55 +0000 | [diff] [blame] | 2 | * Copyright (c) 2016-2020 ARM Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/CL/CLKernelLibrary.h" |
| 25 | |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 26 | #include "arm_compute/core/CL/CLHelpers.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 27 | #include "arm_compute/core/Error.h" |
| 28 | #include "arm_compute/core/Utils.h" |
Matthew Bentham | 758b5ba | 2020-03-05 23:37:48 +0000 | [diff] [blame] | 29 | #include "support/StringSupport.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 30 | |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 31 | #include <algorithm> |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 32 | #include <fstream> |
| 33 | #include <iostream> |
| 34 | #include <utility> |
| 35 | #include <vector> |
| 36 | |
| 37 | using namespace arm_compute; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 38 | const std::map<std::string, std::string> CLKernelLibrary::_kernel_program_map = |
| 39 | { |
| 40 | { "absdiff", "absdiff.cl" }, |
| 41 | { "accumulate", "accumulate.cl" }, |
| 42 | { "accumulate_squared", "accumulate.cl" }, |
| 43 | { "accumulate_weighted", "accumulate.cl" }, |
| 44 | { "activation_layer", "activation_layer.cl" }, |
Manuel Bottini | 30dbeef | 2019-06-26 16:23:03 +0100 | [diff] [blame] | 45 | { "activation_layer_quant", "activation_layer_quant.cl" }, |
| 46 | { "activation_layer_quant_f32", "activation_layer_quant.cl" }, |
Manuel Bottini | 7b9998d | 2019-10-21 17:59:07 +0100 | [diff] [blame] | 47 | { "arg_min_max_x", "arg_min_max.cl" }, |
| 48 | { "arg_min_max_y", "arg_min_max.cl" }, |
| 49 | { "arg_min_max_z", "arg_min_max.cl" }, |
| 50 | { "arg_min_max_w", "arg_min_max.cl" }, |
Michalis Spyrou | f1addb6 | 2018-09-11 11:16:47 +0100 | [diff] [blame] | 51 | { "batch_to_space_nchw", "batch_to_space.cl" }, |
| 52 | { "batch_to_space_static_nchw", "batch_to_space.cl" }, |
| 53 | { "batch_to_space_nhwc", "batch_to_space.cl" }, |
| 54 | { "batch_to_space_static_nhwc", "batch_to_space.cl" }, |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 55 | { "batchnormalization_layer_nchw", "batchnormalization_layer.cl" }, |
| 56 | { "batchnormalization_layer_nhwc", "batchnormalization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 57 | { "bitwise_or", "bitwise_op.cl" }, |
| 58 | { "bitwise_and", "bitwise_op.cl" }, |
| 59 | { "bitwise_xor", "bitwise_op.cl" }, |
| 60 | { "bitwise_not", "bitwise_op.cl" }, |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 61 | { "bounding_box_transform", "bounding_box_transform.cl" }, |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 62 | { "bounding_box_transform_quantized", "bounding_box_transform_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 63 | { "channel_combine_NV", "channel_combine.cl" }, |
| 64 | { "channel_combine_RGB888", "channel_combine.cl" }, |
| 65 | { "channel_combine_RGBA8888", "channel_combine.cl" }, |
| 66 | { "channel_combine_UYVY422", "channel_combine.cl" }, |
| 67 | { "channel_combine_YUYV422", "channel_combine.cl" }, |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 68 | { "channel_shuffle_nchw", "channel_shuffle.cl" }, |
Gian Marco Iodice | 8bab0ee | 2018-09-13 11:51:56 +0100 | [diff] [blame] | 69 | { "channel_shuffle_nhwc", "channel_shuffle.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 70 | { "channel_extract_NV12", "channel_extract.cl" }, |
| 71 | { "channel_extract_NV21", "channel_extract.cl" }, |
| 72 | { "channel_extract_RGB888", "channel_extract.cl" }, |
| 73 | { "channel_extract_RGBA8888", "channel_extract.cl" }, |
| 74 | { "channel_extract_UYVY422", "channel_extract.cl" }, |
| 75 | { "channel_extract_YUYV422", "channel_extract.cl" }, |
| 76 | { "combine_gradients_L1", "canny.cl" }, |
| 77 | { "combine_gradients_L2", "canny.cl" }, |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 78 | { "compare_equal", "comparisons.cl" }, |
| 79 | { "compare_equal_quantized", "comparisons.cl" }, |
| 80 | { "compare_notequal", "comparisons.cl" }, |
| 81 | { "compare_notequal_quantized", "comparisons.cl" }, |
| 82 | { "compare_greater", "comparisons.cl" }, |
| 83 | { "compare_greater_quantized", "comparisons.cl" }, |
| 84 | { "compare_greaterequal", "comparisons.cl" }, |
| 85 | { "compare_greaterequal_quantized", "comparisons.cl" }, |
| 86 | { "compare_less", "comparisons.cl" }, |
| 87 | { "compare_less_quantized", "comparisons.cl" }, |
| 88 | { "compare_lessequal", "comparisons.cl" }, |
| 89 | { "compare_lessequal_quantized", "comparisons.cl" }, |
Vidhya Sudhan Loganathan | 338595b | 2019-06-28 14:09:53 +0100 | [diff] [blame] | 90 | { "concatenate", "concatenate.cl" }, |
Michalis Spyrou | 55b3d12 | 2018-05-09 09:59:23 +0100 | [diff] [blame] | 91 | { "concatenate_width", "concatenate.cl" }, |
Pablo Tello | 6a14adb | 2019-03-05 17:33:08 +0000 | [diff] [blame] | 92 | { "concatenate_height", "concatenate.cl" }, |
Michele Di Giorgio | 27400b9 | 2018-11-01 13:44:05 +0000 | [diff] [blame] | 93 | { "concatenate_width_x2", "concatenate.cl" }, |
| 94 | { "concatenate_width_x4", "concatenate.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 95 | { "convolution_rectangle", "convolution_rectangle.cl" }, |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 96 | { "col2im", "col2im.cl" }, |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 97 | { "convert_depth_down", "depth_convert.cl" }, |
| 98 | { "convert_depth_up", "depth_convert.cl" }, |
| 99 | { "convert_fc_weights", "convert_fc_weights.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 100 | { "convolution3x3_static", "convolution3x3.cl" }, |
| 101 | { "convolution5x5_static", "convolution5x5.cl" }, |
| 102 | { "convolution7x7_static", "convolution7x7.cl" }, |
| 103 | { "convolution9x9_static", "convolution9x9.cl" }, |
| 104 | { "convolution_separable1x5_static", "convolution5x5.cl" }, |
| 105 | { "convolution_separable5x1_static", "convolution5x5.cl" }, |
| 106 | { "convolution_separable1x7_static", "convolution7x7.cl" }, |
| 107 | { "convolution_separable7x1_static", "convolution7x7.cl" }, |
| 108 | { "convolution_separable1x9_static", "convolution9x9.cl" }, |
| 109 | { "convolution_separable9x1_static", "convolution9x9.cl" }, |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 110 | { "copy_tensor", "copy_tensor.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 111 | { "copy_pad_tensor", "copy_tensor.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 112 | { "copy_plane", "channel_extract.cl" }, |
| 113 | { "copy_planes_3p", "channel_combine.cl" }, |
| 114 | { "copy_to_keypoint", "fast_corners.cl" }, |
George Wort | 894066d | 2019-02-15 15:12:52 +0000 | [diff] [blame] | 115 | { "crop_tensor", "crop_tensor.cl" }, |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 116 | { "deconvolution_reshape", "deconvolution_layer.cl" }, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 117 | { "deconvolution_upsample", "deconvolution_layer.cl" }, |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 118 | { "depthwise_convolution_3x3", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 119 | { "depthwise_convolution_3x3_f16", "depthwise_convolution.cl" }, |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 120 | { "depthwise_convolution_3x3_nhwc", "depthwise_convolution.cl" }, |
| 121 | { "depthwise_convolution_3x3_nhwc_stride1", "depthwise_convolution.cl" }, |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 122 | { "dwc_MxN_native_fp_nhwc", "depthwise_convolution.cl" }, |
Michele Di Giorgio | a046e16 | 2019-10-08 09:36:26 +0100 | [diff] [blame] | 123 | { "dwc_MxN_native_quantized8_nhwc", "depthwise_convolution_quantized.cl" }, |
Michele Di Giorgio | df4cf57 | 2019-10-09 15:32:39 +0100 | [diff] [blame] | 124 | { "dwc_3x3_native_quantized8_nchw", "depthwise_convolution_quantized.cl" }, |
| 125 | { "dwc_3x3_native_quantized8_dot8_nchw", "depthwise_convolution_quantized.cl" }, |
| 126 | { "dwc_3x3_reshaped_quantized8_nhwc", "depthwise_convolution_quantized.cl" }, |
| 127 | { "dwc_3x3_reshaped_quantized8_stride1_nhwc", "depthwise_convolution_quantized.cl" }, |
| 128 | { "dwc_3x3_reshaped_quantized8_dot8_stride1_nhwc", "depthwise_convolution_quantized.cl" }, |
Michalis Spyrou | 649962c | 2019-05-22 11:11:55 +0100 | [diff] [blame] | 129 | { "depth_to_space_nchw", "depth_to_space.cl" }, |
| 130 | { "depth_to_space_nhwc", "depth_to_space.cl" }, |
Michele Di Giorgio | 3ebef32 | 2018-02-21 10:02:58 +0000 | [diff] [blame] | 131 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f16", "depthwise_convolution.cl" }, |
| 132 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f16", "depthwise_convolution.cl" }, |
| 133 | { "depthwise_convolution_3x3_stridex1_stridey1_bifrost_f32", "depthwise_convolution.cl" }, |
| 134 | { "depthwise_convolution_3x3_stridex2_stridey2_bifrost_f32", "depthwise_convolution.cl" }, |
giuros01 | 6d10996 | 2019-01-07 17:47:19 +0000 | [diff] [blame] | 135 | { "depthwise_convolution_reshape_weights", "depthwise_convolution.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 136 | { "dequantization_layer", "dequantization_layer.cl" }, |
Michalis Spyrou | 3f632f3 | 2019-08-22 16:52:00 +0100 | [diff] [blame] | 137 | { "dequantization_layer_per_channel_nhwc", "dequantization_layer.cl" }, |
| 138 | { "dequantization_layer_per_channel_nchw", "dequantization_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 139 | { "derivative", "derivative.cl" }, |
| 140 | { "dilate", "dilate.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 141 | { "direct_convolution1x1", "direct_convolution1x1.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 142 | { "direct_convolution1x1_nhwc", "direct_convolution1x1.cl" }, |
Gian Marco Iodice | 1c8409d | 2017-09-06 17:24:25 +0100 | [diff] [blame] | 143 | { "direct_convolution1x1_f32_bifrost", "direct_convolution1x1.cl" }, |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 144 | { "direct_convolution3x3", "direct_convolution3x3.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 145 | { "direct_convolution3x3_nhwc", "direct_convolution3x3.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 146 | { "direct_convolution3x3_f32_bifrost", "direct_convolution3x3.cl" }, |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 147 | { "direct_convolution5x5", "direct_convolution5x5.cl" }, |
Pablo Tello | 3d31946 | 2018-06-21 15:13:17 +0100 | [diff] [blame] | 148 | { "direct_convolution5x5_nhwc", "direct_convolution5x5.cl" }, |
Gian Marco Iodice | 1246b63 | 2017-08-16 18:38:32 +0100 | [diff] [blame] | 149 | { "direct_convolution5x5_f32_bifrost", "direct_convolution5x5.cl" }, |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 150 | { "direct_convolution_quantized", "direct_convolution_quantized.cl" }, |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 151 | { "direct_convolution9x9_nhwc", "direct_convolution9x9.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 152 | { "elementwise_operation_ADD", "elementwise_operation.cl" }, |
| 153 | { "elementwise_operation_SUB", "elementwise_operation.cl" }, |
| 154 | { "elementwise_operation_MAX", "elementwise_operation.cl" }, |
| 155 | { "elementwise_operation_MIN", "elementwise_operation.cl" }, |
| 156 | { "elementwise_operation_DIV", "elementwise_operation.cl" }, |
| 157 | { "elementwise_operation_SQUARED_DIFF", "elementwise_operation.cl" }, |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 158 | { "elementwise_operation_POWER", "elementwise_operation.cl" }, |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 159 | { "elementwise_operation_PRELU", "elementwise_operation.cl" }, |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 160 | { "elementwise_operation_ADD_quantized", "elementwise_operation_quantized.cl" }, |
| 161 | { "elementwise_operation_SUB_quantized", "elementwise_operation_quantized.cl" }, |
| 162 | { "elementwise_operation_MAX_quantized", "elementwise_operation_quantized.cl" }, |
| 163 | { "elementwise_operation_MIN_quantized", "elementwise_operation_quantized.cl" }, |
| 164 | { "elementwise_operation_DIV_quantized", "elementwise_operation_quantized.cl" }, |
| 165 | { "elementwise_operation_SQUARED_DIFF_quantized", "elementwise_operation_quantized.cl" }, |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 166 | { "elementwise_operation_PRELU_quantized", "elementwise_operation_quantized.cl" }, |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 167 | { "elementwise_unary", "elementwise_unary.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 168 | { "erode", "erode.cl" }, |
| 169 | { "fast_corners", "fast_corners.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 170 | { "fft_digit_reverse_axis_0", "fft_digit_reverse.cl" }, |
| 171 | { "fft_digit_reverse_axis_1", "fft_digit_reverse.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 172 | { "fft_radix_2_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 173 | { "fft_radix_2_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 174 | { "fft_radix_2_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 175 | { "fft_radix_2_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 176 | { "fft_radix_3_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 177 | { "fft_radix_3_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 178 | { "fft_radix_3_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 179 | { "fft_radix_3_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 180 | { "fft_radix_4_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 181 | { "fft_radix_4_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 182 | { "fft_radix_4_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 183 | { "fft_radix_4_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 184 | { "fft_radix_5_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 185 | { "fft_radix_5_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 186 | { "fft_radix_5_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 187 | { "fft_radix_5_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 188 | { "fft_radix_7_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 189 | { "fft_radix_7_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 190 | { "fft_radix_7_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 191 | { "fft_radix_7_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 192 | { "fft_radix_8_first_stage_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 193 | { "fft_radix_8_first_stage_axis_1", "fft.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 194 | { "fft_radix_8_axis_0", "fft.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 195 | { "fft_radix_8_axis_1", "fft.cl" }, |
| 196 | { "fft_scale_conj", "fft_scale.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 197 | { "fill_image_borders_constant", "fill_border.cl" }, |
| 198 | { "fill_image_borders_replicate", "fill_border.cl" }, |
| 199 | { "finalize", "optical_flow_pyramid_lk.cl" }, |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 200 | { "flatten", "flatten.cl" }, |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 201 | { "floor_layer", "floor.cl" }, |
Manuel Bottini | 2732cca | 2019-05-28 11:44:41 +0100 | [diff] [blame] | 202 | { "fuse_batchnormalization_layer", "batchnormalization_layer.cl" }, |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 203 | { "gather", "gather.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 204 | { "gaussian1x5_sub_x", "gaussian_pyramid.cl" }, |
| 205 | { "gaussian5x1_sub_y", "gaussian_pyramid.cl" }, |
Gian Marco Iodice | 578ab61 | 2017-06-23 09:34:33 +0100 | [diff] [blame] | 206 | { "gemm_accumulate_biases", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 207 | { "gemm_ma_f16", "gemm.cl" }, |
| 208 | { "gemm_ma_f32", "gemm.cl" }, |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 209 | { "gemm_mv", "gemv.cl" }, |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 210 | { "gemm_mv_quantized", "gemv.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 211 | { "gemm_mm_interleaved_transposed_f16", "gemm.cl" }, |
Vidhya Sudhan Loganathan | 38d93bd | 2018-11-20 15:38:13 +0000 | [diff] [blame] | 212 | { "gemm_mm_interleaved_transposed_f16_acc32", "gemm.cl" }, |
Gian Marco Iodice | bb36a8e | 2018-04-19 12:05:08 +0100 | [diff] [blame] | 213 | { "gemm_mm_interleaved_transposed_f16_bifrost", "gemm.cl" }, |
| 214 | { "gemm_mm_interleaved_transposed_f32", "gemm.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 215 | { "gemm_mm_interleaved_transposed_f32_bifrost", "gemm.cl" }, |
Gian Marco Iodice | edfa9f4 | 2017-08-15 11:45:22 +0100 | [diff] [blame] | 216 | { "gemm_mm_floating_point", "gemm.cl" }, |
Gian Marco Iodice | fd68311 | 2018-04-17 09:52:44 +0100 | [diff] [blame] | 217 | { "gemm_mm_floating_point_f16_bifrost", "gemm.cl" }, |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 218 | { "gemm_mm_floating_point_f16_bifrost_acc32", "gemm.cl" }, |
Anton Lokhmotov | 3e80c7f | 2017-11-20 11:02:10 +0000 | [diff] [blame] | 219 | { "gemm_mm_floating_point_f32_bifrost", "gemm.cl" }, |
| 220 | { "gemm_mm_floating_point_f32_bifrost_1000", "gemm.cl" }, |
giuros01 | b3204e7 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 221 | { "gemm_mm_native", "gemm.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 222 | { "gemm_mm_reshaped_lhs_nt_rhs_t", "gemm.cl" }, |
Giorgio Arena | ae99b6e | 2019-08-01 14:22:12 +0100 | [diff] [blame] | 223 | { "gemm_mm_reshaped_lhs_t_rhs_nt", "gemm.cl" }, |
Gian Marco Iodice | ba5e096 | 2019-03-11 12:17:44 +0000 | [diff] [blame] | 224 | { "gemm_mm_reshaped_only_rhs_nt", "gemm.cl" }, |
Gian Marco Iodice | adc5395 | 2019-02-15 11:10:31 +0000 | [diff] [blame] | 225 | { "gemm_mm_reshaped_only_rhs_t", "gemm.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 226 | { "gemm_lc_vm_f32", "gemm.cl" }, |
Gian Marco Iodice | 5ba5e09 | 2018-12-06 17:13:09 +0000 | [diff] [blame] | 227 | { "gemm_reshape_lhs_matrix_nt", "gemm.cl" }, |
Gian Marco Iodice | 08ddd7b | 2018-12-19 10:01:18 +0000 | [diff] [blame] | 228 | { "gemm_reshape_lhs_matrix_t", "gemm.cl" }, |
Gian Marco Iodice | 3b0a265 | 2018-12-07 11:18:09 +0000 | [diff] [blame] | 229 | { "gemm_reshape_rhs_matrix_nt", "gemm.cl" }, |
| 230 | { "gemm_reshape_rhs_matrix_t", "gemm.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 231 | { "gemmlowp_matrix_a_reduction", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 232 | { "gemmlowp_matrix_a_reduction_dot8", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 233 | { "gemmlowp_matrix_b_reduction", "gemmlowp.cl" }, |
Gian Marco | 7b4d547 | 2018-01-10 15:56:30 +0000 | [diff] [blame] | 234 | { "gemmlowp_mm_midgard", "gemmlowp.cl" }, |
Gian Marco Iodice | e751062 | 2019-06-03 17:28:17 +0100 | [diff] [blame] | 235 | { "gemmlowp_mm_native", "gemmlowp.cl" }, |
Gian Marco Iodice | db63b9c | 2019-01-17 09:47:04 +0000 | [diff] [blame] | 236 | { "gemmlowp_mm_reshaped_lhs_nt_rhs_t", "gemmlowp.cl" }, |
Gian Marco Iodice | 62251f7 | 2019-03-11 16:07:12 +0000 | [diff] [blame] | 237 | { "gemmlowp_mm_reshaped_only_rhs_t", "gemmlowp.cl" }, |
Michele Di Giorgio | b54ba28 | 2020-01-14 15:31:55 +0000 | [diff] [blame] | 238 | { "gemmlowp_mm_reshaped_only_rhs_t_fused_output_stage_fixedpoint", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 239 | { "gemmlowp_offset_contribution", "gemmlowp.cl" }, |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 240 | { "gemmlowp_offset_contribution_quantize_down", "gemmlowp.cl" }, |
| 241 | { "gemmlowp_offset_contribution_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 242 | { "gemmlowp_output_stage_quantize_down", "gemmlowp.cl" }, |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 243 | { "gemmlowp_output_stage_quantize_down_fixedpoint", "gemmlowp.cl" }, |
Manuel Bottini | 9c9b70b | 2019-07-01 17:35:56 +0100 | [diff] [blame] | 244 | { "gemmlowp_output_stage_quantize_down_fixedpoint_qsymm16", "gemmlowp.cl" }, |
Georgios Pinitas | 51e53a3 | 2018-10-22 13:49:08 +0100 | [diff] [blame] | 245 | { "gemmlowp_output_stage_quantize_down_float", "gemmlowp.cl" }, |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 246 | { "generate_proposals_compute_all_anchors", "generate_proposals.cl" }, |
Michele Di Giorgio | 6b612f5 | 2019-09-05 12:30:22 +0100 | [diff] [blame] | 247 | { "generate_proposals_compute_all_anchors_quantized", "generate_proposals_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 248 | { "harris_score_3x3", "harris_corners.cl" }, |
| 249 | { "harris_score_5x5", "harris_corners.cl" }, |
| 250 | { "harris_score_7x7", "harris_corners.cl" }, |
| 251 | { "hist_border_kernel", "histogram.cl" }, |
| 252 | { "hist_border_kernel_fixed", "histogram.cl" }, |
| 253 | { "hist_local_kernel", "histogram.cl" }, |
| 254 | { "hist_local_kernel_fixed", "histogram.cl" }, |
| 255 | { "hog_block_normalization", "hog.cl" }, |
| 256 | { "hog_detector", "hog.cl" }, |
| 257 | { "hog_orientation_binning", "hog.cl" }, |
| 258 | { "hysteresis", "canny.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 259 | { "im2col1x1_stridex1_nchw", "im2col.cl" }, |
| 260 | { "im2col3x3_nchw", "im2col.cl" }, |
| 261 | { "im2col5x5_nchw", "im2col.cl" }, |
| 262 | { "im2col11x11_padx0_pady0_nchw", "im2col.cl" }, |
| 263 | { "im2col_generic_nchw", "im2col.cl" }, |
| 264 | { "im2col_generic_padx0_pady0_nchw", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 265 | { "im2col3x3_nhwc", "im2col.cl" }, |
Gian Marco Iodice | bf9731e | 2018-12-12 10:18:04 +0000 | [diff] [blame] | 266 | { "im2col9x9_nhwc", "im2col.cl" }, |
Pablo Tello | 4a626a7 | 2018-04-04 10:01:14 +0100 | [diff] [blame] | 267 | { "im2col_generic_nhwc", "im2col.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 268 | { "init_level", "optical_flow_pyramid_lk.cl" }, |
| 269 | { "init_level_max", "optical_flow_pyramid_lk.cl" }, |
| 270 | { "init_level_max_initial_estimate", "optical_flow_pyramid_lk.cl" }, |
Manuel Bottini | 79f88e6 | 2019-09-18 15:02:53 +0100 | [diff] [blame] | 271 | { "instance_normalization", "instance_normalization.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 272 | { "integral_horizontal", "integral_image.cl" }, |
| 273 | { "integral_vertical", "integral_image.cl" }, |
| 274 | { "IYUV_to_NV12_bt709", "color_convert.cl" }, |
| 275 | { "IYUV_to_RGB888_bt709", "color_convert.cl" }, |
| 276 | { "IYUV_to_RGBA8888_bt709", "color_convert.cl" }, |
| 277 | { "IYUV_to_YUV444_bt709", "color_convert.cl" }, |
Michalis Spyrou | 5538d34 | 2018-11-14 08:10:13 +0000 | [diff] [blame] | 278 | { "l2_normalize_x", "l2_normalize.cl" }, |
| 279 | { "l2_normalize_y", "l2_normalize.cl" }, |
| 280 | { "l2_normalize_z", "l2_normalize.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 281 | { "lktracker_stage0", "optical_flow_pyramid_lk.cl" }, |
| 282 | { "lktracker_stage1", "optical_flow_pyramid_lk.cl" }, |
| 283 | { "magnitude_phase", "magnitude_phase.cl" }, |
| 284 | { "mean_stddev_accumulate", "mean_stddev.cl" }, |
Michele Di Giorgio | 5b48ad7 | 2019-06-04 18:43:35 +0100 | [diff] [blame] | 285 | { "mean_stddev_normalization", "mean_stddev_normalization.cl" }, |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 286 | { "memset", "memset.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 287 | { "minmax", "minmaxloc.cl" }, |
| 288 | { "minmax_border", "minmaxloc.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 289 | { "minmax_layer", "minmax_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 290 | { "minmaxloc", "minmaxloc.cl" }, |
| 291 | { "non_linear_filter_box3x3", "non_linear_filter3x3.cl" }, |
| 292 | { "non_linear_filter_cross3x3", "non_linear_filter3x3.cl" }, |
| 293 | { "non_linear_filter_disk3x3", "non_linear_filter3x3.cl" }, |
| 294 | { "non_linear_filter_box5x5", "non_linear_filter5x5.cl" }, |
| 295 | { "non_linear_filter_cross5x5", "non_linear_filter5x5.cl" }, |
| 296 | { "non_linear_filter_disk5x5", "non_linear_filter5x5.cl" }, |
| 297 | { "non_max_suppression", "nonmax.cl" }, |
| 298 | { "normalization_layer_cross_map", "normalization_layer.cl" }, |
Michele Di Giorgio | 9d3a831 | 2018-11-20 12:31:24 +0000 | [diff] [blame] | 299 | { "normalization_layer_in_map_nchw", "normalization_layer.cl" }, |
| 300 | { "normalization_layer_in_map_nhwc", "normalization_layer.cl" }, |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 301 | { "normalize_planar_yuv_layer_nchw", "normalize_planar_yuv_layer.cl" }, |
| 302 | { "normalize_planar_yuv_layer_nhwc", "normalize_planar_yuv_layer.cl" }, |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 303 | { "normalize_planar_yuv_layer_q8_nchw", "normalize_planar_yuv_layer_quantized.cl" }, |
| 304 | { "normalize_planar_yuv_layer_q8_nhwc", "normalize_planar_yuv_layer_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 305 | { "NV12_to_IYUV_bt709", "color_convert.cl" }, |
| 306 | { "NV12_to_RGB888_bt709", "color_convert.cl" }, |
| 307 | { "NV12_to_RGBA8888_bt709", "color_convert.cl" }, |
| 308 | { "NV12_to_YUV444_bt709", "color_convert.cl" }, |
| 309 | { "NV21_to_IYUV_bt709", "color_convert.cl" }, |
| 310 | { "NV21_to_RGB888_bt709", "color_convert.cl" }, |
| 311 | { "NV21_to_RGBA8888_bt709", "color_convert.cl" }, |
| 312 | { "NV21_to_YUV444_bt709", "color_convert.cl" }, |
Giorgio Arena | 5c4a8e9 | 2019-08-28 17:55:07 +0100 | [diff] [blame] | 313 | { "pad_layer_constant", "pad_layer.cl" }, |
| 314 | { "pad_layer_symmetric_reflect", "pad_layer.cl" }, |
shubham | e1a4e37 | 2019-01-07 21:37:55 +0530 | [diff] [blame] | 315 | { "permute", "permute.cl" }, |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 316 | { "pixelwise_mul_complex", "pixelwise_mul_float.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 317 | { "pixelwise_mul_float", "pixelwise_mul_float.cl" }, |
| 318 | { "pixelwise_mul_int", "pixelwise_mul_int.cl" }, |
Georgios Pinitas | bf28a3c | 2018-09-18 14:34:48 +0100 | [diff] [blame] | 319 | { "pixelwise_mul_quantized", "pixelwise_mul_int.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 320 | { "pooling_layer_2", "pooling_layer.cl" }, |
| 321 | { "pooling_layer_3", "pooling_layer.cl" }, |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 322 | { "pooling_layer_optimized_3", "pooling_layer.cl" }, |
Georgios Pinitas | ce09314 | 2017-06-19 16:11:53 +0100 | [diff] [blame] | 323 | { "pooling_layer_7", "pooling_layer.cl" }, |
Michalis Spyrou | e74b201 | 2018-04-18 09:49:16 +0100 | [diff] [blame] | 324 | { "pooling_layer_MxN_nchw", "pooling_layer.cl" }, |
| 325 | { "pooling_layer_MxN_nhwc", "pooling_layer.cl" }, |
| 326 | { "pooling_layer_MxN_quantized_nhwc", "pooling_layer_quantized.cl" }, |
| 327 | { "pooling_layer_MxN_quantized_nchw", "pooling_layer_quantized.cl" }, |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 328 | { "prior_box_layer_nchw", "prior_box_layer.cl" }, |
Sheri Zhang | b18252d | 2020-04-07 11:04:57 +0100 | [diff] [blame] | 329 | { "qlstm_layer_normalization", "qlstm_layer_normalization.cl" }, |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 330 | { "quantization_layer", "quantization_layer.cl" }, |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 331 | { "range", "range.cl" }, |
| 332 | { "range_quantized", "range.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 333 | { "reduction_operation_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7930db4 | 2018-11-22 17:36:28 +0000 | [diff] [blame] | 334 | { "reduction_operation_non_parallel_x", "reduction_operation.cl" }, |
Michalis Spyrou | 7e9391b | 2018-10-05 14:49:28 +0100 | [diff] [blame] | 335 | { "reduction_operation_y", "reduction_operation.cl" }, |
| 336 | { "reduction_operation_z", "reduction_operation.cl" }, |
| 337 | { "reduction_operation_w", "reduction_operation.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 338 | { "remap_nearest_neighbour", "remap.cl" }, |
| 339 | { "remap_bilinear", "remap.cl" }, |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 340 | { "reorg_layer_nchw", "reorg_layer.cl" }, |
| 341 | { "reorg_layer_nhwc", "reorg_layer.cl" }, |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 342 | { "reshape_layer", "reshape_layer.cl" }, |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 343 | { "reshape_to_columns", "convolution_layer.cl" }, |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 344 | { "reverse", "reverse.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 345 | { "RGB888_to_IYUV_bt709", "color_convert.cl" }, |
| 346 | { "RGB888_to_NV12_bt709", "color_convert.cl" }, |
| 347 | { "RGB888_to_RGBA8888_bt709", "color_convert.cl" }, |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 348 | { "RGB888_to_U8_bt709", "color_convert.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 349 | { "RGB888_to_YUV444_bt709", "color_convert.cl" }, |
| 350 | { "RGBA8888_to_IYUV_bt709", "color_convert.cl" }, |
| 351 | { "RGBA8888_to_NV12_bt709", "color_convert.cl" }, |
| 352 | { "RGBA8888_to_RGB888_bt709", "color_convert.cl" }, |
| 353 | { "RGBA8888_to_YUV444_bt709", "color_convert.cl" }, |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 354 | { "roi_align_layer", "roi_align_layer.cl" }, |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 355 | { "roi_align_layer_quantized", "roi_align_layer_quantized.cl" }, |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 356 | { "roi_pooling_layer", "roi_pooling_layer.cl" }, |
Michalis Spyrou | 46da23f | 2018-04-10 13:41:30 +0100 | [diff] [blame] | 357 | { "scale_nearest_neighbour_nchw", "scale.cl" }, |
| 358 | { "scale_nearest_neighbour_nhwc", "scale.cl" }, |
| 359 | { "scale_bilinear_nchw", "scale.cl" }, |
| 360 | { "scale_bilinear_nhwc", "scale.cl" }, |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 361 | { "scale_bilinear_quantized_nchw", "scale_quantized.cl" }, |
| 362 | { "scale_bilinear_quantized_nhwc", "scale_quantized.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 363 | { "scharr3x3", "scharr_filter.cl" }, |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 364 | { "select_same_rank", "select.cl" }, |
| 365 | { "select_different_rank_2", "select.cl" }, |
| 366 | { "select_different_rank_n", "select.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 367 | { "sobel3x3", "sobel_filter.cl" }, |
| 368 | { "sobel_separable5x1", "sobel_filter.cl" }, |
| 369 | { "sobel_separable1x5", "sobel_filter.cl" }, |
| 370 | { "sobel_separable7x1", "sobel_filter.cl" }, |
| 371 | { "sobel_separable1x7", "sobel_filter.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 372 | { "softmax_layer_norm", "softmax_layer.cl" }, |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 373 | { "softmax_layer_norm_quantized", "softmax_layer_quantized.cl" }, |
Giorgio Arena | 4402cb9 | 2018-02-15 13:37:40 +0000 | [diff] [blame] | 374 | { "softmax_layer_max_shift_exp_sum_quantized_serial", "softmax_layer_quantized.cl" }, |
| 375 | { "softmax_layer_max_shift_exp_sum_quantized_parallel", "softmax_layer_quantized.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 376 | { "softmax_layer_max_shift_exp_sum_serial", "softmax_layer.cl" }, |
Michalis Spyrou | 13a51e1 | 2018-09-18 13:09:30 +0100 | [diff] [blame] | 377 | { "space_to_batch_nchw", "space_to_batch.cl" }, |
| 378 | { "space_to_batch_static_nchw", "space_to_batch.cl" }, |
| 379 | { "space_to_batch_nhwc", "space_to_batch.cl" }, |
| 380 | { "space_to_batch_static_nhwc", "space_to_batch.cl" }, |
Michalis Spyrou | d69b3b2 | 2019-05-29 17:03:38 +0100 | [diff] [blame] | 381 | { "space_to_depth_nchw", "space_to_depth.cl" }, |
| 382 | { "space_to_depth_nhwc", "space_to_depth.cl" }, |
Chunosov | d6afedc | 2017-11-06 22:09:45 +0700 | [diff] [blame] | 383 | { "softmax_layer_max_shift_exp_sum_parallel", "softmax_layer.cl" }, |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 384 | { "stack_layer", "stack_layer.cl" }, |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 385 | { "strided_slice", "slice_ops.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 386 | { "suppress_non_maximum", "canny.cl" }, |
| 387 | { "tablelookup_U8", "tablelookup.cl" }, |
| 388 | { "tablelookup_S16", "tablelookup.cl" }, |
| 389 | { "threshold_binary", "threshold.cl" }, |
| 390 | { "threshold_range", "threshold.cl" }, |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 391 | { "tile", "tile.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 392 | { "transpose", "transpose.cl" }, |
| 393 | { "UYVY422_to_IYUV_bt709", "color_convert.cl" }, |
| 394 | { "UYVY422_to_NV12_bt709", "color_convert.cl" }, |
| 395 | { "UYVY422_to_RGB888_bt709", "color_convert.cl" }, |
| 396 | { "UYVY422_to_RGBA8888_bt709", "color_convert.cl" }, |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 397 | { "upsample_layer_nchw", "upsample_layer.cl" }, |
| 398 | { "upsample_layer_nhwc", "upsample_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 399 | { "warp_affine_nearest_neighbour", "warp_affine.cl" }, |
| 400 | { "warp_affine_bilinear", "warp_affine.cl" }, |
| 401 | { "warp_perspective_nearest_neighbour", "warp_perspective.cl" }, |
| 402 | { "warp_perspective_bilinear", "warp_perspective.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 403 | { "winograd_filter_transform_2x2_3x3_nchw", "winograd_filter_transform.cl" }, |
| 404 | { "winograd_filter_transform_2x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 405 | { "winograd_filter_transform_1x2_1x3_nchw", "winograd_filter_transform.cl" }, |
| 406 | { "winograd_filter_transform_4x4_3x3_nchw", "winograd_filter_transform.cl" }, |
| 407 | { "winograd_filter_transform_4x1_3x1_nchw", "winograd_filter_transform.cl" }, |
| 408 | { "winograd_filter_transform_1x4_1x3_nchw", "winograd_filter_transform.cl" }, |
| 409 | { "winograd_filter_transform_4x4_5x5_nchw", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 410 | { "winograd_filter_transform_4x1_5x1_nchw", "winograd_filter_transform.cl" }, |
| 411 | { "winograd_filter_transform_1x4_1x5_nchw", "winograd_filter_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 412 | { "winograd_filter_transform_4x1_3x1_nhwc", "winograd_filter_transform.cl" }, |
| 413 | { "winograd_filter_transform_1x4_1x3_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 414 | { "winograd_filter_transform_4x4_3x3_nhwc", "winograd_filter_transform.cl" }, |
| 415 | { "winograd_filter_transform_4x4_5x5_nhwc", "winograd_filter_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 416 | { "winograd_filter_transform_4x1_5x1_nhwc", "winograd_filter_transform.cl" }, |
| 417 | { "winograd_filter_transform_1x4_1x5_nhwc", "winograd_filter_transform.cl" }, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 418 | { "winograd_filter_transform_2x2_7x7_nhwc", "winograd_filter_transform.cl" }, |
| 419 | { "winograd_filter_transform_2x1_7x1_nhwc", "winograd_filter_transform.cl" }, |
| 420 | { "winograd_filter_transform_1x2_1x7_nhwc", "winograd_filter_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 421 | { "winograd_input_transform_2x2_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 422 | { "winograd_input_transform_2x2_3x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 423 | { "winograd_input_transform_2x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 424 | { "winograd_input_transform_2x1_3x1_stepz2_nchw", "winograd_input_transform.cl" }, |
| 425 | { "winograd_input_transform_1x2_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 426 | { "winograd_input_transform_1x2_1x3_stepz2_nchw", "winograd_input_transform.cl" }, |
| 427 | { "winograd_input_transform_4x4_3x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 428 | { "winograd_input_transform_4x1_3x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 429 | { "winograd_input_transform_1x4_1x3_stepz1_nchw", "winograd_input_transform.cl" }, |
| 430 | { "winograd_input_transform_4x4_5x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 431 | { "winograd_input_transform_4x1_5x1_stepz1_nchw", "winograd_input_transform.cl" }, |
| 432 | { "winograd_input_transform_1x4_1x5_stepz1_nchw", "winograd_input_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 433 | { "winograd_input_transform_4x1_3x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 434 | { "winograd_input_transform_1x4_1x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 435 | { "winograd_input_transform_4x4_3x3_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 436 | { "winograd_input_transform_4x4_5x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 437 | { "winograd_input_transform_4x1_5x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 438 | { "winograd_input_transform_1x4_1x5_stepz1_nhwc", "winograd_input_transform.cl" }, |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 439 | { "winograd_input_transform_2x2_7x7_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 440 | { "winograd_input_transform_2x1_7x1_stepz1_nhwc", "winograd_input_transform.cl" }, |
| 441 | { "winograd_input_transform_1x2_1x7_stepz1_nhwc", "winograd_input_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 442 | { "winograd_output_transform_2x2_3x3_nchw", "winograd_output_transform.cl" }, |
| 443 | { "winograd_output_transform_2x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 444 | { "winograd_output_transform_1x2_1x3_nchw", "winograd_output_transform.cl" }, |
| 445 | { "winograd_output_transform_4x4_3x3_nchw", "winograd_output_transform.cl" }, |
| 446 | { "winograd_output_transform_4x1_3x1_nchw", "winograd_output_transform.cl" }, |
| 447 | { "winograd_output_transform_1x4_1x3_nchw", "winograd_output_transform.cl" }, |
| 448 | { "winograd_output_transform_4x4_5x5_nchw", "winograd_output_transform.cl" }, |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 449 | { "winograd_output_transform_4x1_5x1_nchw", "winograd_output_transform.cl" }, |
| 450 | { "winograd_output_transform_1x4_1x5_nchw", "winograd_output_transform.cl" }, |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 451 | { "winograd_output_transform_4x1_3x1_nhwc", "winograd_output_transform.cl" }, |
| 452 | { "winograd_output_transform_1x4_1x3_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 453 | { "winograd_output_transform_4x4_3x3_nhwc", "winograd_output_transform.cl" }, |
| 454 | { "winograd_output_transform_4x4_5x5_nhwc", "winograd_output_transform.cl" }, |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 455 | { "winograd_output_transform_4x1_5x1_nhwc", "winograd_output_transform.cl" }, |
| 456 | { "winograd_output_transform_1x4_1x5_nhwc", "winograd_output_transform.cl" }, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 457 | { "winograd_output_transform_2x2_7x7_nhwc", "winograd_output_transform.cl" }, |
| 458 | { "winograd_output_transform_2x1_7x1_nhwc", "winograd_output_transform.cl" }, |
| 459 | { "winograd_output_transform_1x2_1x7_nhwc", "winograd_output_transform.cl" }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 460 | { "yolo_layer_nchw", "yolo_layer.cl" }, |
| 461 | { "yolo_layer_nhwc", "yolo_layer.cl" }, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 462 | { "YUYV422_to_IYUV_bt709", "color_convert.cl" }, |
| 463 | { "YUYV422_to_NV12_bt709", "color_convert.cl" }, |
| 464 | { "YUYV422_to_RGB888_bt709", "color_convert.cl" }, |
| 465 | { "YUYV422_to_RGBA8888_bt709", "color_convert.cl" }, |
| 466 | }; |
| 467 | |
| 468 | const std::map<std::string, std::string> CLKernelLibrary::_program_source_map = |
| 469 | { |
| 470 | #ifdef EMBEDDED_KERNELS |
| 471 | { |
| 472 | "absdiff.cl", |
| 473 | #include "./cl_kernels/absdiff.clembed" |
| 474 | }, |
| 475 | { |
| 476 | "accumulate.cl", |
| 477 | #include "./cl_kernels/accumulate.clembed" |
| 478 | }, |
| 479 | { |
| 480 | "activation_layer.cl", |
| 481 | #include "./cl_kernels/activation_layer.clembed" |
| 482 | }, |
| 483 | { |
Manuel Bottini | 30dbeef | 2019-06-26 16:23:03 +0100 | [diff] [blame] | 484 | "activation_layer_quant.cl", |
| 485 | #include "./cl_kernels/activation_layer_quant.clembed" |
Michel Iwaniec | 0063380 | 2017-10-12 14:14:15 +0100 | [diff] [blame] | 486 | }, |
| 487 | { |
Manuel Bottini | 7b9998d | 2019-10-21 17:59:07 +0100 | [diff] [blame] | 488 | "arg_min_max.cl", |
| 489 | #include "./cl_kernels/arg_min_max.clembed" |
| 490 | }, |
| 491 | { |
Michalis Spyrou | 6a8d3b6 | 2018-08-31 10:07:09 +0100 | [diff] [blame] | 492 | "batch_to_space.cl", |
| 493 | #include "./cl_kernels/batch_to_space.clembed" |
| 494 | }, |
| 495 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 496 | "bitwise_op.cl", |
| 497 | #include "./cl_kernels/bitwise_op.clembed" |
| 498 | }, |
| 499 | { |
giuros01 | c04a0e8 | 2018-10-03 12:44:35 +0100 | [diff] [blame] | 500 | "bounding_box_transform.cl", |
| 501 | #include "./cl_kernels/bounding_box_transform.clembed" |
| 502 | }, |
| 503 | { |
Michele Di Giorgio | 4aff98f | 2019-08-28 16:27:26 +0100 | [diff] [blame] | 504 | "bounding_box_transform_quantized.cl", |
| 505 | #include "./cl_kernels/bounding_box_transform_quantized.clembed" |
| 506 | }, |
| 507 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 508 | "canny.cl", |
| 509 | #include "./cl_kernels/canny.clembed" |
| 510 | }, |
| 511 | { |
| 512 | "channel_combine.cl", |
| 513 | #include "./cl_kernels/channel_combine.clembed" |
| 514 | }, |
| 515 | { |
| 516 | "channel_extract.cl", |
| 517 | #include "./cl_kernels/channel_extract.clembed" |
| 518 | }, |
| 519 | { |
Michele Di Giorgio | 7217563 | 2018-05-01 16:52:00 +0100 | [diff] [blame] | 520 | "channel_shuffle.cl", |
| 521 | #include "./cl_kernels/channel_shuffle.clembed" |
| 522 | }, |
| 523 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 524 | "col2im.cl", |
| 525 | #include "./cl_kernels/col2im.clembed" |
| 526 | }, |
| 527 | { |
Georgios Pinitas | 7900a9e | 2018-11-23 11:44:58 +0000 | [diff] [blame] | 528 | "comparisons.cl", |
| 529 | #include "./cl_kernels/comparisons.clembed" |
| 530 | }, |
| 531 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 532 | "concatenate.cl", |
| 533 | #include "./cl_kernels/concatenate.clembed" |
| 534 | }, |
| 535 | { |
| 536 | "color_convert.cl", |
| 537 | #include "./cl_kernels/color_convert.clembed" |
| 538 | }, |
| 539 | { |
Giorgio Arena | 657bdb3 | 2018-04-26 18:52:01 +0100 | [diff] [blame] | 540 | "convert_fc_weights.cl", |
| 541 | #include "./cl_kernels/convert_fc_weights.clembed" |
| 542 | }, |
| 543 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 544 | "convolution3x3.cl", |
| 545 | #include "./cl_kernels/convolution3x3.clembed" |
| 546 | }, |
| 547 | { |
| 548 | "convolution5x5.cl", |
| 549 | #include "./cl_kernels/convolution5x5.clembed" |
| 550 | }, |
| 551 | { |
| 552 | "convolution7x7.cl", |
| 553 | #include "./cl_kernels/convolution7x7.clembed" |
| 554 | }, |
| 555 | { |
| 556 | "convolution9x9.cl", |
| 557 | #include "./cl_kernels/convolution9x9.clembed" |
| 558 | }, |
| 559 | { |
| 560 | "convolution_layer.cl", |
| 561 | #include "./cl_kernels/convolution_layer.clembed" |
| 562 | }, |
| 563 | { |
| 564 | "convolution_rectangle.cl", |
| 565 | #include "./cl_kernels/convolution_rectangle.clembed" |
| 566 | }, |
| 567 | { |
Michalis Spyrou | 5c8e05c | 2018-03-22 11:56:01 +0000 | [diff] [blame] | 568 | "copy_tensor.cl", |
| 569 | #include "./cl_kernels/copy_tensor.clembed" |
| 570 | }, |
| 571 | { |
George Wort | 894066d | 2019-02-15 15:12:52 +0000 | [diff] [blame] | 572 | "crop_tensor.cl", |
| 573 | #include "./cl_kernels/crop_tensor.clembed" |
| 574 | }, |
| 575 | { |
Michalis Spyrou | ceb889e | 2018-09-17 18:24:41 +0100 | [diff] [blame] | 576 | "upsample_layer.cl", |
| 577 | #include "./cl_kernels/upsample_layer.clembed" |
| 578 | }, |
| 579 | { |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 580 | "deconvolution_layer.cl", |
| 581 | #include "./cl_kernels/deconvolution_layer.clembed" |
| 582 | }, |
| 583 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 584 | "depth_convert.cl", |
| 585 | #include "./cl_kernels/depth_convert.clembed" |
| 586 | }, |
| 587 | { |
Michalis Spyrou | 649962c | 2019-05-22 11:11:55 +0100 | [diff] [blame] | 588 | "depth_to_space.cl", |
| 589 | #include "./cl_kernels/depth_to_space.clembed" |
| 590 | }, |
| 591 | { |
Giorgio Arena | 93a690e | 2017-08-01 16:09:33 +0100 | [diff] [blame] | 592 | "depthwise_convolution.cl", |
| 593 | #include "./cl_kernels/depthwise_convolution.clembed" |
| 594 | }, |
| 595 | { |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 596 | "depthwise_convolution_quantized.cl", |
| 597 | #include "./cl_kernels/depthwise_convolution_quantized.clembed" |
| 598 | }, |
| 599 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 600 | "dequantization_layer.cl", |
| 601 | #include "./cl_kernels/dequantization_layer.clembed" |
| 602 | }, |
| 603 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 604 | "derivative.cl", |
| 605 | #include "./cl_kernels/derivative.clembed" |
| 606 | }, |
| 607 | { |
| 608 | "dilate.cl", |
| 609 | #include "./cl_kernels/dilate.clembed" |
| 610 | }, |
| 611 | { |
SiCong Li | c51b72f | 2017-07-28 14:46:20 +0100 | [diff] [blame] | 612 | "direct_convolution1x1.cl", |
| 613 | #include "./cl_kernels/direct_convolution1x1.clembed" |
| 614 | }, |
| 615 | { |
| 616 | "direct_convolution3x3.cl", |
| 617 | #include "./cl_kernels/direct_convolution3x3.clembed" |
steniu01 | 27b386c | 2017-07-18 17:37:43 +0100 | [diff] [blame] | 618 | }, |
| 619 | { |
steniu01 | db00668 | 2017-08-09 16:26:22 +0100 | [diff] [blame] | 620 | "direct_convolution5x5.cl", |
| 621 | #include "./cl_kernels/direct_convolution5x5.clembed" |
| 622 | }, |
| 623 | { |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 624 | "direct_convolution_quantized.cl", |
| 625 | #include "./cl_kernels/direct_convolution_quantized.clembed" |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 626 | }, |
| 627 | { |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 628 | "direct_convolution9x9.cl", |
| 629 | #include "./cl_kernels/direct_convolution9x9.clembed" |
| 630 | }, |
| 631 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 632 | "elementwise_operation.cl", |
| 633 | #include "./cl_kernels/elementwise_operation.clembed" |
| 634 | }, |
| 635 | { |
| 636 | "elementwise_operation_quantized.cl", |
| 637 | #include "./cl_kernels/elementwise_operation_quantized.clembed" |
| 638 | }, |
| 639 | { |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 640 | "elementwise_unary.cl", |
| 641 | #include "./cl_kernels/elementwise_unary.clembed" |
| 642 | }, |
| 643 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 644 | "erode.cl", |
| 645 | #include "./cl_kernels/erode.clembed" |
| 646 | }, |
| 647 | { |
| 648 | "fast_corners.cl", |
| 649 | #include "./cl_kernels/fast_corners.clembed" |
| 650 | }, |
| 651 | { |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 652 | "fft.cl", |
| 653 | #include "./cl_kernels/fft.clembed" |
Gian Marco Iodice | 215b4ea | 2018-06-28 16:29:29 +0100 | [diff] [blame] | 654 | }, |
| 655 | { |
Georgios Pinitas | 8be9148 | 2019-03-26 17:23:28 +0000 | [diff] [blame] | 656 | "fft_digit_reverse.cl", |
| 657 | #include "./cl_kernels/fft_digit_reverse.clembed" |
| 658 | }, |
| 659 | { |
| 660 | "fft_scale.cl", |
| 661 | #include "./cl_kernels/fft_scale.clembed" |
| 662 | }, |
| 663 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 664 | "fill_border.cl", |
| 665 | #include "./cl_kernels/fill_border.clembed" |
| 666 | }, |
| 667 | { |
Georgios Pinitas | 0bc7849 | 2019-03-18 20:07:37 +0000 | [diff] [blame] | 668 | "flatten.cl", |
| 669 | #include "./cl_kernels/flatten.clembed" |
| 670 | }, |
| 671 | { |
Georgios Pinitas | d8e765b | 2017-08-02 13:44:33 +0100 | [diff] [blame] | 672 | "floor.cl", |
| 673 | #include "./cl_kernels/floor.clembed" |
| 674 | }, |
| 675 | { |
Manuel Bottini | 8529bd6 | 2018-11-21 11:53:04 +0000 | [diff] [blame] | 676 | "gather.cl", |
| 677 | #include "./cl_kernels/gather.clembed" |
| 678 | }, |
| 679 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 680 | "gaussian_pyramid.cl", |
| 681 | #include "./cl_kernels/gaussian_pyramid.clembed" |
| 682 | }, |
| 683 | { |
| 684 | "gemm.cl", |
| 685 | #include "./cl_kernels/gemm.clembed" |
| 686 | }, |
| 687 | { |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 688 | "gemmlowp.cl", |
| 689 | #include "./cl_kernels/gemmlowp.clembed" |
| 690 | }, |
| 691 | { |
Giorgio Arena | 9fe4144 | 2017-08-23 16:36:24 +0100 | [diff] [blame] | 692 | "gemv.cl", |
| 693 | #include "./cl_kernels/gemv.clembed" |
| 694 | }, |
| 695 | { |
Manuel Bottini | 5209be5 | 2019-02-13 16:34:56 +0000 | [diff] [blame] | 696 | "generate_proposals.cl", |
| 697 | #include "./cl_kernels/generate_proposals.clembed" |
| 698 | }, |
| 699 | { |
Michele Di Giorgio | 6b612f5 | 2019-09-05 12:30:22 +0100 | [diff] [blame] | 700 | "generate_proposals_quantized.cl", |
| 701 | #include "./cl_kernels/generate_proposals_quantized.clembed" |
| 702 | }, |
| 703 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 704 | "harris_corners.cl", |
| 705 | #include "./cl_kernels/harris_corners.clembed" |
| 706 | }, |
| 707 | { |
| 708 | "helpers.h", |
| 709 | #include "./cl_kernels/helpers.hembed" |
| 710 | }, |
| 711 | { |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 712 | "helpers_asymm.h", |
| 713 | #include "./cl_kernels/helpers_asymm.hembed" |
| 714 | }, |
| 715 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 716 | "histogram.cl", |
| 717 | #include "./cl_kernels/histogram.clembed" |
| 718 | }, |
| 719 | { |
| 720 | "hog.cl", |
| 721 | #include "./cl_kernels/hog.clembed" |
| 722 | }, |
| 723 | { |
Gian Marco | 76faef8 | 2018-01-29 12:15:32 +0000 | [diff] [blame] | 724 | "im2col.cl", |
| 725 | #include "./cl_kernels/im2col.clembed" |
| 726 | }, |
| 727 | { |
Manuel Bottini | 79f88e6 | 2019-09-18 15:02:53 +0100 | [diff] [blame] | 728 | "instance_normalization.cl", |
| 729 | #include "./cl_kernels/instance_normalization.clembed" |
| 730 | }, |
| 731 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 732 | "integral_image.cl", |
| 733 | #include "./cl_kernels/integral_image.clembed" |
| 734 | }, |
| 735 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 736 | "l2_normalize.cl", |
| 737 | #include "./cl_kernels/l2_normalize.clembed" |
| 738 | }, |
| 739 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 740 | "magnitude_phase.cl", |
| 741 | #include "./cl_kernels/magnitude_phase.clembed" |
| 742 | }, |
| 743 | { |
| 744 | "mean_stddev.cl", |
| 745 | #include "./cl_kernels/mean_stddev.clembed" |
| 746 | }, |
| 747 | { |
Michele Di Giorgio | 5b48ad7 | 2019-06-04 18:43:35 +0100 | [diff] [blame] | 748 | "mean_stddev_normalization.cl", |
| 749 | #include "./cl_kernels/mean_stddev_normalization.clembed" |
| 750 | }, |
| 751 | { |
Giuseppe Rossini | d7647d4 | 2018-07-17 18:13:13 +0100 | [diff] [blame] | 752 | "memset.cl", |
| 753 | #include "./cl_kernels/memset.clembed" |
| 754 | }, |
| 755 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 756 | "minmaxloc.cl", |
| 757 | #include "./cl_kernels/minmaxloc.clembed" |
| 758 | }, |
| 759 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 760 | "minmax_layer.cl", |
| 761 | #include "./cl_kernels/minmax_layer.clembed" |
| 762 | }, |
| 763 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 764 | "non_linear_filter3x3.cl", |
| 765 | #include "./cl_kernels/non_linear_filter3x3.clembed" |
| 766 | }, |
| 767 | { |
| 768 | "non_linear_filter5x5.cl", |
| 769 | #include "./cl_kernels/non_linear_filter5x5.clembed" |
| 770 | }, |
| 771 | { |
| 772 | "non_linear_filter_helpers.h", |
| 773 | #include "./cl_kernels/non_linear_filter_helpers.hembed" |
| 774 | }, |
| 775 | { |
| 776 | "nonmax.cl", |
| 777 | #include "./cl_kernels/nonmax.clembed" |
| 778 | }, |
| 779 | { |
| 780 | "normalization_layer.cl", |
| 781 | #include "./cl_kernels/normalization_layer.clembed" |
| 782 | }, |
| 783 | { |
Michele Di Giorgio | b57be0d | 2018-08-31 16:26:25 +0100 | [diff] [blame] | 784 | "normalize_planar_yuv_layer.cl", |
| 785 | #include "./cl_kernels/normalize_planar_yuv_layer.clembed" |
| 786 | }, |
| 787 | { |
Michele Di Giorgio | d63dfa2 | 2018-09-12 10:18:54 +0100 | [diff] [blame] | 788 | "normalize_planar_yuv_layer_quantized.cl", |
| 789 | #include "./cl_kernels/normalize_planar_yuv_layer_quantized.clembed" |
| 790 | }, |
| 791 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 792 | "batchnormalization_layer.cl", |
| 793 | #include "./cl_kernels/batchnormalization_layer.clembed" |
| 794 | }, |
| 795 | { |
| 796 | "optical_flow_pyramid_lk.cl", |
| 797 | #include "./cl_kernels/optical_flow_pyramid_lk.clembed" |
| 798 | }, |
| 799 | { |
Giorgio Arena | 205eed8 | 2019-08-14 10:13:50 +0100 | [diff] [blame] | 800 | "pad_layer.cl", |
| 801 | #include "./cl_kernels/pad_layer.clembed" |
| 802 | }, |
| 803 | { |
Michalis Spyrou | 5237e01 | 2018-01-17 09:40:27 +0000 | [diff] [blame] | 804 | "permute.cl", |
| 805 | #include "./cl_kernels/permute.clembed" |
| 806 | }, |
| 807 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 808 | "pixelwise_mul_float.cl", |
| 809 | #include "./cl_kernels/pixelwise_mul_float.clembed" |
| 810 | }, |
| 811 | { |
| 812 | "pixelwise_mul_int.cl", |
| 813 | #include "./cl_kernels/pixelwise_mul_int.clembed" |
| 814 | }, |
| 815 | { |
| 816 | "pooling_layer.cl", |
| 817 | #include "./cl_kernels/pooling_layer.clembed" |
| 818 | }, |
| 819 | { |
Anton Lokhmotov | af6204c | 2017-11-08 09:34:19 +0000 | [diff] [blame] | 820 | "pooling_layer_quantized.cl", |
| 821 | #include "./cl_kernels/pooling_layer_quantized.clembed" |
| 822 | }, |
| 823 | { |
Michalis Spyrou | 6c7c38e | 2018-08-29 16:28:11 +0100 | [diff] [blame] | 824 | "prior_box_layer.cl", |
| 825 | #include "./cl_kernels/prior_box_layer.clembed" |
| 826 | }, |
| 827 | { |
Sheri Zhang | b18252d | 2020-04-07 11:04:57 +0100 | [diff] [blame] | 828 | "qlstm_layer_normalization.cl", |
| 829 | #include "./cl_kernels/qlstm_layer_normalization.clembed" |
| 830 | }, |
| 831 | { |
Michele Di Giorgio | 56dd726 | 2017-07-27 09:53:49 +0100 | [diff] [blame] | 832 | "quantization_layer.cl", |
| 833 | #include "./cl_kernels/quantization_layer.clembed" |
| 834 | }, |
| 835 | { |
Vidhya Sudhan Loganathan | 5e96be7 | 2018-12-18 14:17:00 +0000 | [diff] [blame] | 836 | "range.cl", |
| 837 | #include "./cl_kernels/range.clembed" |
| 838 | }, |
| 839 | { |
Michalis Spyrou | 04f089c | 2017-08-08 17:42:38 +0100 | [diff] [blame] | 840 | "reduction_operation.cl", |
| 841 | #include "./cl_kernels/reduction_operation.clembed" |
| 842 | }, |
| 843 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 844 | "remap.cl", |
| 845 | #include "./cl_kernels/remap.clembed" |
| 846 | }, |
| 847 | { |
Gian Marco Iodice | 477531c | 2018-08-21 17:53:38 +0100 | [diff] [blame] | 848 | "reorg_layer.cl", |
| 849 | #include "./cl_kernels/reorg_layer.clembed" |
| 850 | }, |
| 851 | { |
Georgios Pinitas | 5ee66ea | 2017-09-07 17:29:16 +0100 | [diff] [blame] | 852 | "reshape_layer.cl", |
| 853 | #include "./cl_kernels/reshape_layer.clembed" |
| 854 | }, |
| 855 | { |
Michele Di Giorgio | 5daeffd | 2018-11-26 10:01:15 +0000 | [diff] [blame] | 856 | "reverse.cl", |
| 857 | #include "./cl_kernels/reverse.clembed" |
| 858 | }, |
| 859 | { |
giuros01 | 1887081 | 2018-09-13 09:31:40 +0100 | [diff] [blame] | 860 | "roi_align_layer.cl", |
| 861 | #include "./cl_kernels/roi_align_layer.clembed" |
| 862 | }, |
| 863 | { |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 864 | "roi_align_layer_quantized.cl", |
| 865 | #include "./cl_kernels/roi_align_layer_quantized.clembed" |
| 866 | }, |
| 867 | { |
SiCong Li | 3e36369 | 2017-07-04 15:02:10 +0100 | [diff] [blame] | 868 | "roi_pooling_layer.cl", |
| 869 | #include "./cl_kernels/roi_pooling_layer.clembed" |
| 870 | }, |
| 871 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 872 | "scale.cl", |
| 873 | #include "./cl_kernels/scale.clembed" |
| 874 | }, |
| 875 | { |
Michalis Spyrou | 17220e2 | 2018-09-12 13:35:38 +0100 | [diff] [blame] | 876 | "scale_quantized.cl", |
| 877 | #include "./cl_kernels/scale_quantized.clembed" |
| 878 | }, |
| 879 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 880 | "scharr_filter.cl", |
| 881 | #include "./cl_kernels/scharr_filter.clembed" |
| 882 | }, |
| 883 | { |
Georgios Pinitas | aaa2718 | 2018-11-21 16:32:15 +0000 | [diff] [blame] | 884 | "select.cl", |
| 885 | #include "./cl_kernels/select.clembed" |
| 886 | }, |
| 887 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 888 | "sobel_filter.cl", |
| 889 | #include "./cl_kernels/sobel_filter.clembed" |
| 890 | }, |
| 891 | { |
| 892 | "softmax_layer.cl", |
| 893 | #include "./cl_kernels/softmax_layer.clembed" |
| 894 | }, |
| 895 | { |
Chunosov | f450caa | 2017-11-08 16:09:35 +0700 | [diff] [blame] | 896 | "softmax_layer_quantized.cl", |
| 897 | #include "./cl_kernels/softmax_layer_quantized.clembed" |
| 898 | }, |
| 899 | { |
Georgios Pinitas | c1a7245 | 2018-08-24 11:25:32 +0100 | [diff] [blame] | 900 | "slice_ops.cl", |
| 901 | #include "./cl_kernels/slice_ops.clembed" |
Georgios Pinitas | 77589b5 | 2018-08-21 14:41:35 +0100 | [diff] [blame] | 902 | }, |
| 903 | { |
Michalis Spyrou | 16934a5 | 2018-08-21 18:03:58 +0100 | [diff] [blame] | 904 | "space_to_batch.cl", |
| 905 | #include "./cl_kernels/space_to_batch.clembed" |
| 906 | }, |
| 907 | { |
Michalis Spyrou | d69b3b2 | 2019-05-29 17:03:38 +0100 | [diff] [blame] | 908 | "space_to_depth.cl", |
| 909 | #include "./cl_kernels/space_to_depth.clembed" |
| 910 | }, |
| 911 | { |
Gian Marco Iodice | 8aa985e | 2018-11-27 15:58:08 +0000 | [diff] [blame] | 912 | "stack_layer.cl", |
| 913 | #include "./cl_kernels/stack_layer.clembed" |
| 914 | }, |
| 915 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 916 | "tablelookup.cl", |
| 917 | #include "./cl_kernels/tablelookup.clembed" |
| 918 | }, |
| 919 | { |
| 920 | "threshold.cl", |
| 921 | #include "./cl_kernels/threshold.clembed" |
| 922 | }, |
| 923 | { |
giuros01 | 3175fcf | 2018-11-21 09:59:17 +0000 | [diff] [blame] | 924 | "tile.cl", |
| 925 | #include "./cl_kernels/tile.clembed" |
| 926 | }, |
| 927 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 928 | "transpose.cl", |
| 929 | #include "./cl_kernels/transpose.clembed" |
| 930 | }, |
| 931 | { |
| 932 | "types.h", |
| 933 | #include "./cl_kernels/types.hembed" |
| 934 | }, |
| 935 | { |
| 936 | "warp_affine.cl", |
| 937 | #include "./cl_kernels/warp_affine.clembed" |
| 938 | }, |
| 939 | { |
| 940 | "warp_helpers.h", |
| 941 | #include "./cl_kernels/warp_helpers.hembed" |
| 942 | }, |
| 943 | { |
| 944 | "warp_perspective.cl", |
| 945 | #include "./cl_kernels/warp_perspective.clembed" |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 946 | }, |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 947 | { |
Giorgio Arena | a50e5e0 | 2018-07-02 13:42:23 +0100 | [diff] [blame] | 948 | "winograd_filter_transform.cl", |
| 949 | #include "./cl_kernels/winograd_filter_transform.clembed" |
| 950 | }, |
| 951 | { |
| 952 | "winograd_input_transform.cl", |
| 953 | #include "./cl_kernels/winograd_input_transform.clembed" |
| 954 | }, |
| 955 | { |
| 956 | "winograd_output_transform.cl", |
| 957 | #include "./cl_kernels/winograd_output_transform.clembed" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 958 | }, |
Giorgio Arena | 7302302 | 2018-09-04 14:55:55 +0100 | [diff] [blame] | 959 | { |
| 960 | "yolo_layer.cl", |
| 961 | #include "./cl_kernels/yolo_layer.clembed" |
| 962 | }, |
Anthony Barbier | ac69aa1 | 2017-07-03 17:39:37 +0100 | [diff] [blame] | 963 | #endif /* EMBEDDED_KERNELS */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 964 | }; |
| 965 | |
| 966 | CLKernelLibrary::CLKernelLibrary() |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 967 | : _compile_context(), _kernel_path() |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 968 | { |
Anthony Barbier | ecb1c62 | 2018-04-17 11:45:10 +0100 | [diff] [blame] | 969 | 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] | 970 | } |
| 971 | |
| 972 | CLKernelLibrary &CLKernelLibrary::get() |
| 973 | { |
| 974 | static CLKernelLibrary _kernel_library; |
| 975 | return _kernel_library; |
| 976 | } |
| 977 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 978 | Kernel CLKernelLibrary::create_kernel(const std::string &kernel_name, const std::set<std::string> &build_options_set) const |
| 979 | { |
| 980 | const std::string program_name = get_program_name(kernel_name); |
| 981 | auto program = get_program(program_name); |
| 982 | |
| 983 | return _compile_context.create_kernel(kernel_name, program_name, program.first, _kernel_path, build_options_set, program.second); |
| 984 | } |
| 985 | |
| 986 | std::string CLKernelLibrary::get_program_name(const std::string &kernel_name) const |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 987 | { |
| 988 | // Find which program contains the kernel |
| 989 | auto kernel_program_it = _kernel_program_map.find(kernel_name); |
| 990 | |
| 991 | if(_kernel_program_map.end() == kernel_program_it) |
| 992 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 993 | ARM_COMPUTE_ERROR_VAR("Kernel %s not found in the CLKernelLibrary", kernel_name.c_str()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 994 | } |
steniu01 | 3470247 | 2017-07-11 09:22:58 +0100 | [diff] [blame] | 995 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 996 | const std::string program_name = kernel_program_it->second; |
Georgios Pinitas | df473ea | 2018-05-31 18:53:52 +0100 | [diff] [blame] | 997 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 998 | return program_name; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 999 | } |
| 1000 | |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1001 | void CLKernelLibrary::init(std::string kernel_path, cl::Context context, cl::Device device) |
| 1002 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1003 | _compile_context = CLCompileContext(context, device); |
| 1004 | _kernel_path = kernel_path; |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1005 | } |
| 1006 | |
| 1007 | void CLKernelLibrary::set_kernel_path(const std::string &kernel_path) |
| 1008 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1009 | _kernel_path = std::move(kernel_path); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1010 | } |
| 1011 | |
| 1012 | cl::Context &CLKernelLibrary::context() |
| 1013 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1014 | return _compile_context.context(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1015 | } |
| 1016 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1017 | const cl::Device &CLKernelLibrary::get_device() |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1018 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1019 | return _compile_context.get_device(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1020 | } |
| 1021 | |
| 1022 | void CLKernelLibrary::set_device(cl::Device device) |
| 1023 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1024 | _compile_context.set_device(device); |
| 1025 | } |
| 1026 | |
| 1027 | void CLKernelLibrary::set_context(cl::Context context) |
| 1028 | { |
| 1029 | _compile_context.set_context(context); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1030 | } |
| 1031 | |
| 1032 | std::string CLKernelLibrary::get_kernel_path() |
| 1033 | { |
| 1034 | return _kernel_path; |
| 1035 | } |
| 1036 | |
| 1037 | void CLKernelLibrary::clear_programs_cache() |
| 1038 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1039 | _compile_context.clear_programs_cache(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1040 | } |
| 1041 | |
| 1042 | const std::map<std::string, cl::Program> &CLKernelLibrary::get_built_programs() const |
| 1043 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1044 | return _compile_context.get_built_programs(); |
Pablo Tello | db8485a | 2019-09-24 11:03:47 +0100 | [diff] [blame] | 1045 | } |
| 1046 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 1047 | void CLKernelLibrary::add_built_program(const std::string &built_program_name, const cl::Program &program) |
Anthony Barbier | 7da55aa | 2018-04-13 16:58:43 +0100 | [diff] [blame] | 1048 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1049 | _compile_context.add_built_program(built_program_name, program); |
Anthony Barbier | 7da55aa | 2018-04-13 16:58:43 +0100 | [diff] [blame] | 1050 | } |
| 1051 | |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 1052 | bool CLKernelLibrary::fp16_supported() const |
| 1053 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1054 | return _compile_context.fp16_supported(); |
Vidhya Sudhan Loganathan | f1f4906 | 2018-05-25 13:21:26 +0100 | [diff] [blame] | 1055 | } |
| 1056 | |
Vidhya Sudhan Loganathan | 76c8564 | 2018-05-25 13:53:02 +0100 | [diff] [blame] | 1057 | bool CLKernelLibrary::int64_base_atomics_supported() const |
| 1058 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1059 | return _compile_context.int64_base_atomics_supported(); |
Vidhya Sudhan Loganathan | 76c8564 | 2018-05-25 13:53:02 +0100 | [diff] [blame] | 1060 | } |
| 1061 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1062 | std::pair<std::string, bool> CLKernelLibrary::get_program(const std::string &program_name) const |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1063 | { |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1064 | #ifdef EMBEDDED_KERNELS |
| 1065 | const auto program_source_it = _program_source_map.find(program_name); |
| 1066 | |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1067 | if(program_source_it == _program_source_map.end()) |
| 1068 | { |
Michalis Spyrou | 7c60c99 | 2019-10-10 14:33:47 +0100 | [diff] [blame] | 1069 | ARM_COMPUTE_ERROR_VAR("Embedded program for %s does not exist.", program_name.c_str()); |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1070 | } |
| 1071 | |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1072 | return std::make_pair(program_source_it->second, false); |
| 1073 | #else /* EMBEDDED_KERNELS */ |
| 1074 | // Check for binary |
| 1075 | std::string source_name = _kernel_path + program_name; |
| 1076 | std::string binary_name = source_name + "bin"; |
| 1077 | std::string program_source{}; |
| 1078 | bool is_binary = false; |
| 1079 | |
| 1080 | if(std::ifstream(binary_name).is_open()) |
| 1081 | { |
| 1082 | program_source = read_file(binary_name, true); |
| 1083 | is_binary = true; |
| 1084 | } |
| 1085 | else if(std::ifstream(source_name).is_open()) |
| 1086 | { |
| 1087 | program_source = read_file(source_name, false); |
| 1088 | } |
| 1089 | else |
| 1090 | { |
| 1091 | ARM_COMPUTE_ERROR_VAR("Kernel file %s does not exist.", source_name.c_str()); |
| 1092 | } |
| 1093 | |
| 1094 | return std::make_pair(program_source, is_binary); |
| 1095 | #endif /* EMBEDDED_KERNELS */ |
Michalis Spyrou | d7e8281 | 2017-06-20 15:00:14 +0100 | [diff] [blame] | 1096 | } |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1097 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1098 | size_t CLKernelLibrary::max_local_workgroup_size(const cl::Kernel &kernel) const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1099 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1100 | return _compile_context.max_local_workgroup_size(kernel); |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1101 | } |
| 1102 | |
Abel Bernabeu | 5a6e053 | 2017-09-28 09:53:45 +0100 | [diff] [blame] | 1103 | cl::NDRange CLKernelLibrary::default_ndrange() const |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1104 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1105 | return _compile_context.default_ndrange(); |
steniu01 | 5f91072 | 2017-08-23 10:15:22 +0100 | [diff] [blame] | 1106 | } |
Anthony Barbier | 847864d | 2018-03-07 11:35:53 +0000 | [diff] [blame] | 1107 | |
| 1108 | std::string CLKernelLibrary::get_device_version() |
| 1109 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1110 | return _compile_context.get_device_version(); |
Anthony Barbier | 847864d | 2018-03-07 11:35:53 +0000 | [diff] [blame] | 1111 | } |
Giorgio Arena | 5d42b46 | 2019-07-26 15:54:20 +0100 | [diff] [blame] | 1112 | |
| 1113 | cl_uint CLKernelLibrary::get_num_compute_units() |
| 1114 | { |
Michalis Spyrou | 11d4918 | 2020-03-26 10:31:32 +0000 | [diff] [blame] | 1115 | return _compile_context.get_num_compute_units(); |
| 1116 | } |
| 1117 | |
| 1118 | CLCompileContext &CLKernelLibrary::get_compile_context() |
| 1119 | { |
| 1120 | return _compile_context; |
Michele Di Giorgio | 578a9fc | 2019-08-23 11:49:04 +0100 | [diff] [blame] | 1121 | } |