From 7fdcfb113cc5651eeb5f35333a41434bc4c2223f Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 9 Jan 2020 16:45:46 +0000 Subject: COMPMID-2819: Retain layout during configuration for multiple functions. Signed-off-by: Georgios Pinitas Change-Id: Ia528762dc5a93bebfd8fd037bf1f4e75d0b8a6de Reviewed-on: https://review.mlplatform.org/c/2566 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- .../kernels/CLDeconvolutionLayerUpsampleKernel.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/core/CL/kernels/CLDeconvolutionLayerUpsampleKernel.cpp') 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: { -- cgit v1.2.1