diff options
author | Pablo Tello <pablo.tello@arm.com> | 2019-02-27 13:32:51 +0000 |
---|---|---|
committer | Giuseppe Rossini <giuseppe.rossini@arm.com> | 2019-03-08 10:41:25 +0000 |
commit | 471043616a869f0e696c8db4e1d0a62b45b4decf (patch) | |
tree | 79f3386c4d6757472835003fbf552566213f3bce /src/core/CL/kernels | |
parent | adc5395ad72aceb2c9e7e6beb54d949959d35143 (diff) | |
download | ComputeLibrary-471043616a869f0e696c8db4e1d0a62b45b4decf.tar.gz |
COMPMID-1882: Improve memory coalescence when reshaping the weights for CLDepthwiseConvolution
Change-Id: I97788d9e349f37fcd818d588d668e2d5e22fd568
Signed-off-by: giuros01 <giuseppe.rossini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/818
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'src/core/CL/kernels')
-rw-r--r-- | src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp | 5 | ||||
-rw-r--r-- | src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp | 16 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp index e8efe6f0a9..770740d180 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp @@ -171,7 +171,10 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen { const bool is_dot8_supported = dot8_supported(CLKernelLibrary::get().get_device()); - kernel_name = is_qasymm ? (std::string("depthwise_convolution_3x3_quantized") + (is_dot8_supported ? "_dot8" : "") + "_nchw") : "depthwise_convolution_3x3"; + kernel_name = is_qasymm ? "dwc_3x3_native_qasymm8" : "depthwise_convolution_3x3"; + kernel_name += (is_qasymm && is_dot8_supported ? "_dot8" : ""); + kernel_name += "_nchw"; + num_elems_written_per_iteration_x = 8 / data_size_from_type(input->data_type()); num_elems_written_per_iteration_y = (is_qasymm && conv_stride_y == 1) ? 2 : 1; num_elems_read_per_iteration_x = 3 + (num_elems_written_per_iteration_x - 1) * conv_stride_x; diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp index a82d3a6fae..431039c31f 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp @@ -252,9 +252,21 @@ void CLDepthwiseConvolutionLayer3x3NHWCKernel::configure(const ICLTensor *input, build_opts.add_option_if(_input->info()->tensor_shape().total_size_upper(3) > 1, "-DDST_DEPTH=" + support::cpp11::to_string(static_cast<int>(std::ceil(_output->info()->dimension(2) / static_cast<float>(_num_planes_processed_per_iteration))))); + std::string kernel_name; // Create kernel - std::string kernel_name = std::string("depthwise_convolution_3x3") + (is_qasymm ? std::string("_quantized") + ((is_dot8_supported - && is_stride_1) ? "_dot8" : "") : "") + "_nhwc" + (is_stride_1 ? "_stride1" : ""); + if(is_qasymm) + { + kernel_name = std::string("dwc_3x3_reshaped_qasymm8"); + kernel_name += (is_dot8_supported && is_stride_1 ? "_dot8" : ""); + kernel_name += (is_stride_1 ? "_stride1" : ""); + kernel_name += "_nhwc"; + } + else + { + kernel_name = std::string("depthwise_convolution_3x3_nhwc"); + kernel_name += (is_stride_1 ? "_stride1" : ""); + } + ICLKernel::configure_internal(win_config.second); _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts.options())); |