diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-01-09 16:45:46 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-01-10 16:58:20 +0000 |
commit | 7fdcfb113cc5651eeb5f35333a41434bc4c2223f (patch) | |
tree | 3a5cfaed83f8bb9ca88b0fdf44c263088338dc4f /src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp | |
parent | 07958785a2542bf461be48241127d4ad5044d08a (diff) | |
download | ComputeLibrary-7fdcfb113cc5651eeb5f35333a41434bc4c2223f.tar.gz |
COMPMID-2819: Retain layout during configuration for multiple functions.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ia528762dc5a93bebfd8fd037bf1f4e75d0b8a6de
Reviewed-on: https://review.mlplatform.org/c/2566
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp b/src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp index 819e3c910a..cd9552f149 100644 --- a/src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp +++ b/src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -35,7 +35,7 @@ using namespace arm_compute; CLDeconvolutionLayerUpsampleKernel::CLDeconvolutionLayerUpsampleKernel() - : _input(nullptr), _output(nullptr), _info() + : _input(nullptr), _output(nullptr), _info(), _data_layout(DataLayout::UNKNOWN) { } @@ -72,13 +72,14 @@ void CLDeconvolutionLayerUpsampleKernel::configure(const ICLTensor *input, ICLTe { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - _input = input; - _output = output; - _info = info; - // Perform validation step ARM_COMPUTE_ERROR_THROW_ON(CLDeconvolutionLayerUpsampleKernel::validate(input->info(), output->info(), info)); + _input = input; + _output = output; + _info = info; + _data_layout = input->info()->data_layout(); + // Create kernel CLBuildOptions build_opts; build_opts.add_option(("-DDATA_TYPE=" + get_cl_type_from_data_type(input->info()->data_type()))); @@ -99,10 +100,8 @@ void CLDeconvolutionLayerUpsampleKernel::run(const Window &window, cl::CommandQu ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(ICLKernel::window(), window); - const DataLayout data_layout = _input->info()->data_layout(); - - const size_t idx_w = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); - const size_t idx_h = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); + const size_t idx_w = get_data_layout_dimension_index(_data_layout, DataLayoutDimension::WIDTH); + const size_t idx_h = get_data_layout_dimension_index(_data_layout, DataLayoutDimension::HEIGHT); const int out_start_x = _info.pad_left(); const int out_end_x = _output->info()->dimension(idx_w) - _info.pad_right() + _info.stride().first - 1; @@ -112,7 +111,7 @@ void CLDeconvolutionLayerUpsampleKernel::run(const Window &window, cl::CommandQu const int out_end_y = _output->info()->dimension(idx_h) - _info.pad_bottom() + _info.stride().second - 1; const int out_step_y = _info.stride().second; - switch(data_layout) + switch(_data_layout) { case DataLayout::NCHW: { |