From b88272e2dcf09803cd275cfeb5ca1ea743a091ff Mon Sep 17 00:00:00 2001 From: SiCongLi Date: Wed, 24 Feb 2021 15:40:57 +0000 Subject: Remove usage of valid window region in NHWC CPU kernels - Part2 Remove set_valid_region methods from all NHWC CPU ML functions / operators / kernels Resolves COMPMID-4152 (2/2) Change-Id: If9725e9c5b0213b87db96675e81b7fb724970b98 Signed-off-by: SiCongLi Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5203 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- src/core/NEON/kernels/NEBatchNormalizationLayerKernel.cpp | 4 ---- src/core/NEON/kernels/NEBitwiseAndKernel.cpp | 7 +------ src/core/NEON/kernels/NEBitwiseNotKernel.cpp | 3 +-- src/core/NEON/kernels/NEBitwiseOrKernel.cpp | 7 +------ src/core/NEON/kernels/NEBitwiseXorKernel.cpp | 6 +----- src/core/NEON/kernels/NEBoundingBoxTransformKernel.cpp | 5 +---- src/core/NEON/kernels/NEChannelShuffleLayerKernel.cpp | 4 ---- src/core/NEON/kernels/NECol2ImKernel.cpp | 3 --- src/core/NEON/kernels/NEDepthConvertLayerKernel.cpp | 7 ++----- .../kernels/NEDepthwiseConvolutionLayerNativeKernel.cpp | 7 ++----- src/core/NEON/kernels/NEDequantizationLayerKernel.cpp | 5 +---- src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp | 3 --- .../kernels/NEDirectConvolutionLayerOutputStageKernel.cpp | 13 +------------ src/core/NEON/kernels/NEFFTDigitReverseKernel.cpp | 3 +-- src/core/NEON/kernels/NEFFTRadixStageKernel.cpp | 6 +----- src/core/NEON/kernels/NEFFTScaleKernel.cpp | 5 +---- src/core/NEON/kernels/NEFuseBatchNormalizationKernel.cpp | 4 +--- src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp | 4 ---- src/core/NEON/kernels/NEGEMMLowpMatrixMultiplyKernel.cpp | 7 +------ .../NEON/kernels/NEGEMMLowpOffsetContributionKernel.cpp | 7 ++----- .../NEGEMMLowpOffsetContributionOutputStageKernel.cpp | 5 +---- .../NEON/kernels/NEGEMMLowpQuantizeDownInt32ScaleKernel.cpp | 7 ++----- ...MLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel.cpp | 5 +---- ...MMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp | 5 +---- ...MLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp | 5 +---- src/core/NEON/kernels/NEGEMMLowpReductionKernel.cpp | 4 +--- src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp | 5 +---- src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp | 4 ---- src/core/NEON/kernels/NEGatherKernel.cpp | 3 +-- src/core/NEON/kernels/NEIm2ColKernel.cpp | 1 - .../NEON/kernels/NEInstanceNormalizationLayerKernel.cpp | 3 --- src/core/NEON/kernels/NEL2NormalizeLayerKernel.cpp | 5 +---- src/core/NEON/kernels/NEMeanStdDevNormalizationKernel.cpp | 6 +----- src/core/NEON/kernels/NEMinMaxLayerKernel.cpp | 4 +--- src/core/NEON/kernels/NENormalizationLayerKernel.cpp | 5 +---- src/core/NEON/kernels/NEPadLayerKernel.cpp | 5 +---- src/core/NEON/kernels/NEPriorBoxLayerKernel.cpp | 9 +++------ src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.cpp | 7 ++----- src/core/NEON/kernels/NEQuantizationLayerKernel.cpp | 6 +----- src/core/NEON/kernels/NEROIAlignLayerKernel.cpp | 6 +----- src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp | 6 +----- src/core/NEON/kernels/NERangeKernel.cpp | 5 +---- src/core/NEON/kernels/NEReductionOperationKernel.cpp | 4 ---- src/core/NEON/kernels/NEReorgLayerKernel.cpp | 1 - src/core/NEON/kernels/NEScaleKernel.cpp | 5 +---- src/core/NEON/kernels/NEStridedSliceKernel.cpp | 3 +-- src/core/NEON/kernels/NETransposeKernel.cpp | 5 ----- src/core/NEON/kernels/NEWeightsReshapeKernel.cpp | 7 +++---- src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp | 3 +-- src/core/cpu/kernels/CpuActivationKernel.cpp | 4 ---- src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp | 5 +---- src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp | 6 +----- src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp | 5 +---- src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp | 6 ++---- src/core/cpu/kernels/CpuFloorKernel.cpp | 4 ---- src/core/cpu/kernels/CpuPermuteKernel.cpp | 3 --- src/core/cpu/kernels/CpuPoolingKernel.cpp | 5 +---- src/core/cpu/kernels/CpuReshapeKernel.cpp | 4 +--- src/core/cpu/kernels/CpuSoftmaxKernel.cpp | 10 ++-------- 59 files changed, 56 insertions(+), 245 deletions(-) diff --git a/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.cpp b/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.cpp index 7f707d7f1a..9d47d7d76f 100644 --- a/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.cpp +++ b/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.cpp @@ -359,10 +359,6 @@ void NEBatchNormalizationLayerKernel::configure(ITensor *input, ITensor *output, { // Output auto initialization if not yet initialized auto_init_if_empty(*output->info(), *input->info()->clone()); - - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); } } diff --git a/src/core/NEON/kernels/NEBitwiseAndKernel.cpp b/src/core/NEON/kernels/NEBitwiseAndKernel.cpp index 4f4de70c3c..677c5cddcc 100644 --- a/src/core/NEON/kernels/NEBitwiseAndKernel.cpp +++ b/src/core/NEON/kernels/NEBitwiseAndKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -91,11 +91,6 @@ void NEBitwiseAndKernel::configure(const ITensor *input1, const ITensor *input2, AccessWindowHorizontal(input2->info(), 0, num_elems_processed_per_iteration), output_access); - const ValidRegion valid_region = intersect_valid_regions(input1->info()->valid_region(), - input2->info()->valid_region()); - - output_access.set_valid_region(win, valid_region); - INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEBitwiseNotKernel.cpp b/src/core/NEON/kernels/NEBitwiseNotKernel.cpp index c69c4ea046..19b1af690a 100644 --- a/src/core/NEON/kernels/NEBitwiseNotKernel.cpp +++ b/src/core/NEON/kernels/NEBitwiseNotKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -78,7 +78,6 @@ void NEBitwiseNotKernel::configure(const ITensor *input, ITensor *output) Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration)); AccessWindowHorizontal output_access(output->info(), 0, num_elems_processed_per_iteration); update_window_and_padding(win, AccessWindowHorizontal(input->info(), 0, num_elems_processed_per_iteration), output_access); - output_access.set_valid_region(win, input->info()->valid_region()); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEBitwiseOrKernel.cpp b/src/core/NEON/kernels/NEBitwiseOrKernel.cpp index 875e6391a5..08094fbfcf 100644 --- a/src/core/NEON/kernels/NEBitwiseOrKernel.cpp +++ b/src/core/NEON/kernels/NEBitwiseOrKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -87,11 +87,6 @@ void NEBitwiseOrKernel::configure(const ITensor *input1, const ITensor *input2, AccessWindowHorizontal(input2->info(), 0, num_elems_processed_per_iteration), output_access); - const ValidRegion valid_region = intersect_valid_regions(input1->info()->valid_region(), - input2->info()->valid_region()); - - output_access.set_valid_region(win, valid_region); - INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEBitwiseXorKernel.cpp b/src/core/NEON/kernels/NEBitwiseXorKernel.cpp index 603b49d5eb..fc5b38b64f 100644 --- a/src/core/NEON/kernels/NEBitwiseXorKernel.cpp +++ b/src/core/NEON/kernels/NEBitwiseXorKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -84,10 +84,6 @@ void NEBitwiseXorKernel::configure(const ITensor *input1, const ITensor *input2, update_window_and_padding(win, AccessWindowHorizontal(input1->info(), 0, num_elems_processed_per_iteration), AccessWindowHorizontal(input2->info(), 0, num_elems_processed_per_iteration), output_access); - const ValidRegion valid_region = intersect_valid_regions(input1->info()->valid_region(), input2->info()->valid_region()); - - output_access.set_valid_region(win, valid_region); - INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEBoundingBoxTransformKernel.cpp b/src/core/NEON/kernels/NEBoundingBoxTransformKernel.cpp index 03d6e1c600..9662203b82 100644 --- a/src/core/NEON/kernels/NEBoundingBoxTransformKernel.cpp +++ b/src/core/NEON/kernels/NEBoundingBoxTransformKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -101,9 +101,6 @@ void NEBoundingBoxTransformKernel::configure(const ITensor *boxes, ITensor *pred const unsigned int num_boxes = boxes->info()->dimension(1); Window win = calculate_max_window(*pred_boxes->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(pred_boxes->info()->num_dimensions()); - pred_boxes->info()->set_valid_region(ValidRegion(coord, pred_boxes->info()->tensor_shape())); win.set(Window::DimX, Window::Dimension(0, 1u)); win.set(Window::DimY, Window::Dimension(0, num_boxes)); diff --git a/src/core/NEON/kernels/NEChannelShuffleLayerKernel.cpp b/src/core/NEON/kernels/NEChannelShuffleLayerKernel.cpp index 4a2213a30b..c9066578b2 100644 --- a/src/core/NEON/kernels/NEChannelShuffleLayerKernel.cpp +++ b/src/core/NEON/kernels/NEChannelShuffleLayerKernel.cpp @@ -155,10 +155,6 @@ void NEChannelShuffleLayerKernel::configure(const ITensor *input, ITensor *outpu Window win = calculate_max_window(*input->info(), Steps()); // The NEChannelShuffleLayerKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NECol2ImKernel.cpp b/src/core/NEON/kernels/NECol2ImKernel.cpp index bbc86a9a05..26e4455c4a 100644 --- a/src/core/NEON/kernels/NECol2ImKernel.cpp +++ b/src/core/NEON/kernels/NECol2ImKernel.cpp @@ -67,9 +67,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen Window win = calculate_max_window(*input, Steps()); // The NECol2ImKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEDepthConvertLayerKernel.cpp b/src/core/NEON/kernels/NEDepthConvertLayerKernel.cpp index d6c89a4553..4b5208eeb6 100644 --- a/src/core/NEON/kernels/NEDepthConvertLayerKernel.cpp +++ b/src/core/NEON/kernels/NEDepthConvertLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -122,10 +122,7 @@ void NEDepthConvertLayerKernel::configure(const ITensor *input, ITensor *output, ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), policy, shift)); // Configure kernel window - Window win = calculate_max_window(*input->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + Window win = calculate_max_window(*input->info(), Steps()); ICPPKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEDepthwiseConvolutionLayerNativeKernel.cpp b/src/core/NEON/kernels/NEDepthwiseConvolutionLayerNativeKernel.cpp index 23b9bc5819..3ab21d5747 100644 --- a/src/core/NEON/kernels/NEDepthwiseConvolutionLayerNativeKernel.cpp +++ b/src/core/NEON/kernels/NEDepthwiseConvolutionLayerNativeKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -847,10 +847,7 @@ void NEDepthwiseConvolutionLayerNativeKernel::configure(const ITensor *input, co const TensorShape output_shape = misc::shape_calculator::compute_depthwise_convolution_shape(*input->info(), *weights->info(), conv_info, depth_multiplier, dilation); auto_init_if_empty(*output->info(), input->info()->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(output_shape).set_quantization_info(output->info()->quantization_info())); - Window win = calculate_max_window(*output->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + Window win = calculate_max_window(*output->info(), Steps()); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEDequantizationLayerKernel.cpp b/src/core/NEON/kernels/NEDequantizationLayerKernel.cpp index 36e9c92c56..c8d923018d 100644 --- a/src/core/NEON/kernels/NEDequantizationLayerKernel.cpp +++ b/src/core/NEON/kernels/NEDequantizationLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -66,9 +66,6 @@ std::tuple validate_and_configure_window(ITensorInfo *input, ITe auto_init_if_empty(*output, input->tensor_shape(), 1, DataType::F32); // NEDequantizationLayerKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_tuple(Status{}, win); } diff --git a/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp b/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp index 77742163fa..e81d50fe5f 100644 --- a/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp +++ b/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp @@ -977,9 +977,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen { // Configure window NHWC without any padding win = calculate_max_window(*output, Steps()); - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); } Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{}; diff --git a/src/core/NEON/kernels/NEDirectConvolutionLayerOutputStageKernel.cpp b/src/core/NEON/kernels/NEDirectConvolutionLayerOutputStageKernel.cpp index f072851240..8dcbd00ddc 100644 --- a/src/core/NEON/kernels/NEDirectConvolutionLayerOutputStageKernel.cpp +++ b/src/core/NEON/kernels/NEDirectConvolutionLayerOutputStageKernel.cpp @@ -406,18 +406,7 @@ void NEDirectConvolutionLayerOutputStageKernel::configure(ITensor *input, const auto_init_if_empty(*output->info(), input->info()->clone()->set_data_type(output_dt)); } - Window win = calculate_max_window(*input->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(input->info()->num_dimensions()); - - if(output != nullptr && (output->info()->total_size() != 0)) - { - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - } - else - { - input->info()->set_valid_region(ValidRegion(coord, input->info()->tensor_shape())); - } + Window win = calculate_max_window(*input->info(), Steps()); INEKernel::configure(win); diff --git a/src/core/NEON/kernels/NEFFTDigitReverseKernel.cpp b/src/core/NEON/kernels/NEFFTDigitReverseKernel.cpp index 200ee6bf88..261437f07d 100644 --- a/src/core/NEON/kernels/NEFFTDigitReverseKernel.cpp +++ b/src/core/NEON/kernels/NEFFTDigitReverseKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -63,7 +63,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen auto_init_if_empty(*output, input->clone()->set_num_channels(2)); Window win = calculate_max_window(*input, Steps()); - input->set_valid_region(ValidRegion(Coordinates(), input->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp b/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp index 971d4fdefe..d71707a4fc 100644 --- a/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp +++ b/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -927,10 +927,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen } Window win = calculate_max_window(*input, Steps()); - if(output != nullptr) - { - output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape())); - } return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEFFTScaleKernel.cpp b/src/core/NEON/kernels/NEFFTScaleKernel.cpp index 6dc5541e94..5ec330bebc 100644 --- a/src/core/NEON/kernels/NEFFTScaleKernel.cpp +++ b/src/core/NEON/kernels/NEFFTScaleKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -77,9 +77,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen auto_init_if_empty(*output, *input->clone()); // NEFFTScaleKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); } return std::make_pair(Status{}, win); diff --git a/src/core/NEON/kernels/NEFuseBatchNormalizationKernel.cpp b/src/core/NEON/kernels/NEFuseBatchNormalizationKernel.cpp index 99f830fe06..0d3244c409 100644 --- a/src/core/NEON/kernels/NEFuseBatchNormalizationKernel.cpp +++ b/src/core/NEON/kernels/NEFuseBatchNormalizationKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -444,13 +444,11 @@ void NEFuseBatchNormalizationKernel::configure(const ITensor *input_weights, con { // Output tensor auto initialization if not yet initialized auto_init_if_empty(*_fused_weights->info(), *_input_weights->info()->clone()); - fused_weights->info()->set_valid_region(input_weights->info()->valid_region()); } if(_fused_bias != nullptr) { // Output tensor auto initialization if not yet initialized auto_init_if_empty(*_fused_bias->info(), *_bn_mean->info()->clone()); - _fused_bias->info()->set_valid_region(bn_mean->info()->valid_region()); } // Validate arguments diff --git a/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp b/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp index 6b2383f043..96ed810e0e 100644 --- a/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp +++ b/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp @@ -101,10 +101,6 @@ void NEGEMMInterleave4x4Kernel::configure(const ITensor *input, ITensor *output) Window win = calculate_max_window(*input->info(), Steps(1, 4)); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEGEMMLowpMatrixMultiplyKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpMatrixMultiplyKernel.cpp index 4dbfc3b022..0aad0a7ec2 100644 --- a/src/core/NEON/kernels/NEGEMMLowpMatrixMultiplyKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpMatrixMultiplyKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -923,15 +923,10 @@ void NEGEMMLowpMatrixMultiplyKernel::configure(const ITensor *input0, const ITen { // Configure kernel window win = calculate_max_window(*output->info(), Steps(num_elems_processed_per_iteration_x)); - - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); } else { win = calculate_max_window(*output->info(), Steps(num_elems_processed_per_iteration_x, num_elems_processed_per_iteration_y)); - output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape())); } INEKernel::configure(win); diff --git a/src/core/NEON/kernels/NEGEMMLowpOffsetContributionKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpOffsetContributionKernel.cpp index 174a06955f..1a859b5f0e 100644 --- a/src/core/NEON/kernels/NEGEMMLowpOffsetContributionKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpOffsetContributionKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -386,10 +386,7 @@ void NEGEMMLowpOffsetContributionKernel::configure(ITensor *mm_result, const ITe } // Configure kernel window - Window win = calculate_max_window(*mm_result->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(mm_result->info()->num_dimensions()); - mm_result->info()->set_valid_region(ValidRegion(coord, mm_result->info()->tensor_shape())); + Window win = calculate_max_window(*mm_result->info(), Steps()); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp index 3c8f5ae022..0abf9c4046 100644 --- a/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -851,9 +851,6 @@ std::pair validate_and_configure_window(ITensorInfo *mm_result, // Note: This kernel performs 16 elements per iteration. // However, since we use a left-over for loop, we cannot have any read or write out of memory // For this reason num_elems_processed_per_iteration is 1 and so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ScaleKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ScaleKernel.cpp index 2e78107a1a..84365ba25b 100644 --- a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ScaleKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ScaleKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Arm Limited. + * Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -279,10 +279,7 @@ void NEGEMMLowpQuantizeDownInt32ScaleKernel::configure(const ITensor *input, con _output_stage = output_stage; // Configure kernel window - Window win = calculate_max_window(*input->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + Window win = calculate_max_window(*input->info(), Steps()); INEKernel::configure(win); diff --git a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel.cpp index 1fafc62302..6bc63e01e2 100644 --- a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -76,9 +76,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen Window win = calculate_max_window(*input, Steps()); // NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp index bf9ce9554d..a9e70c6542 100644 --- a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -76,9 +76,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen Window win = calculate_max_window(*input, Steps()); // NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp index cbb56da8c0..3cc3fde6f5 100644 --- a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -76,9 +76,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen Window win = calculate_max_window(*input, Steps()); // NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEGEMMLowpReductionKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpReductionKernel.cpp index db038e559e..965b04df2c 100644 --- a/src/core/NEON/kernels/NEGEMMLowpReductionKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpReductionKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -82,7 +82,6 @@ void NEGEMMLowpMatrixAReductionKernel::configure(const ITensor *mtx_a, ITensor * auto_init_if_empty(*_output->info(), TensorShape(_input->info()->dimension(1)), 1, DataType::S32); Window win = calculate_max_window(*_output->info(), Steps(1)); - _output->info()->set_valid_region(ValidRegion(Coordinates(), _output->info()->tensor_shape())); INEKernel::configure(win); } @@ -204,7 +203,6 @@ void NEGEMMLowpMatrixBReductionKernel::configure(const ITensor *mtx_b, ITensor * // Configure kernel window Window win = calculate_max_window_horizontal(*_output->info(), Steps(num_elems_processed_per_iteration)); - _output->info()->set_valid_region(ValidRegion(Coordinates(), _output->info()->tensor_shape())); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp b/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp index fc95c08f62..7f63f45e7e 100644 --- a/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -1127,9 +1127,6 @@ void NEGEMMMatrixMultiplyKernel::configure(const ITensor *input0, const ITensor win = calculate_max_window(*output->info(), Steps(num_elems_processed_per_iteration_x, num_elems_processed_per_iteration_y)); } - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp b/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp index cea95749f8..ad7ae505f4 100644 --- a/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMTranspose1xWKernel.cpp @@ -82,10 +82,6 @@ void NEGEMMTranspose1xWKernel::configure(const ITensor *input, ITensor *output) // Configure kernel window Window win = calculate_max_window(*input->info(), Steps(vector_size)); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEGatherKernel.cpp b/src/core/NEON/kernels/NEGatherKernel.cpp index 55ecb8840f..e5c48c7439 100644 --- a/src/core/NEON/kernels/NEGatherKernel.cpp +++ b/src/core/NEON/kernels/NEGatherKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -184,7 +184,6 @@ void NEGatherKernel::configure(const ITensor *input, const ITensor *indices, ITe // Create window Window win = calculate_max_window(*output->info(), Steps()); - output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape())); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEIm2ColKernel.cpp b/src/core/NEON/kernels/NEIm2ColKernel.cpp index 728cecd074..a28a77a4fb 100644 --- a/src/core/NEON/kernels/NEIm2ColKernel.cpp +++ b/src/core/NEON/kernels/NEIm2ColKernel.cpp @@ -98,7 +98,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen win.set(channel_idx, Window::Dimension(0, 1, 1)); // The NEIm2ColKernel doesn't need padding so update_window_and_padding() can be skipped - output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEInstanceNormalizationLayerKernel.cpp b/src/core/NEON/kernels/NEInstanceNormalizationLayerKernel.cpp index a3f7d8d634..fa1f7a6c49 100644 --- a/src/core/NEON/kernels/NEInstanceNormalizationLayerKernel.cpp +++ b/src/core/NEON/kernels/NEInstanceNormalizationLayerKernel.cpp @@ -205,9 +205,6 @@ std::tuple validate_and_configure_window(ITensorInfo *input, ITe auto_init_if_empty(*output, input->tensor_shape(), 1, input->data_type()); // NEInstanceNormalizationLayerKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_pair(Status{}, win); } } // namespace diff --git a/src/core/NEON/kernels/NEL2NormalizeLayerKernel.cpp b/src/core/NEON/kernels/NEL2NormalizeLayerKernel.cpp index dae5b57fec..9bda82d416 100644 --- a/src/core/NEON/kernels/NEL2NormalizeLayerKernel.cpp +++ b/src/core/NEON/kernels/NEL2NormalizeLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -165,9 +165,6 @@ std::tuple validate_and_configure_window(ITensorInfo *input, ITe auto_init_if_empty(*output, input->tensor_shape(), 1, input->data_type()); // NEL2NormalizeLayerKernel doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->num_dimensions()); - output->set_valid_region(ValidRegion(coord, output->tensor_shape())); return std::make_tuple(Status{}, win); } diff --git a/src/core/NEON/kernels/NEMeanStdDevNormalizationKernel.cpp b/src/core/NEON/kernels/NEMeanStdDevNormalizationKernel.cpp index 6a41e3a161..d1c7d4eb91 100644 --- a/src/core/NEON/kernels/NEMeanStdDevNormalizationKernel.cpp +++ b/src/core/NEON/kernels/NEMeanStdDevNormalizationKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -67,10 +67,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen // This kernel doesn't need padding. A left-over for loop on dimension X, we cannot have any read or write out of memory // For this reason num_elems_processed_per_iteration is set to 1 Window win = calculate_max_window(*input, Steps()); - if(output != nullptr) - { - output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape())); - } return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NEMinMaxLayerKernel.cpp b/src/core/NEON/kernels/NEMinMaxLayerKernel.cpp index 92f6b4a42e..5ea8947fa0 100644 --- a/src/core/NEON/kernels/NEMinMaxLayerKernel.cpp +++ b/src/core/NEON/kernels/NEMinMaxLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -81,8 +81,6 @@ std::tuple validate_and_configure_window(ITensorInfo *input, ITe bool window_changed = update_window_and_padding(win, input_access, output_access); - output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape())); - Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{}; return std::make_tuple(err, win); } diff --git a/src/core/NEON/kernels/NENormalizationLayerKernel.cpp b/src/core/NEON/kernels/NENormalizationLayerKernel.cpp index a7900ee074..21a70ae513 100644 --- a/src/core/NEON/kernels/NENormalizationLayerKernel.cpp +++ b/src/core/NEON/kernels/NENormalizationLayerKernel.cpp @@ -163,10 +163,7 @@ void NENormalizationLayerKernel::configure(const ITensor *input, const ITensor * } // Configure kernel window - Window win = calculate_max_window(*input->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + Window win = calculate_max_window(*input->info(), Steps()); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEPadLayerKernel.cpp b/src/core/NEON/kernels/NEPadLayerKernel.cpp index 200fe2ce54..3e2c57a18c 100644 --- a/src/core/NEON/kernels/NEPadLayerKernel.cpp +++ b/src/core/NEON/kernels/NEPadLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -236,9 +236,6 @@ void NEPadLayerKernel::configure(ITensor *input, ITensor *output, const PaddingL Window win = calculate_max_window(*output->info(), Steps()); // The NEPad doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); ICPPKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEPriorBoxLayerKernel.cpp b/src/core/NEON/kernels/NEPriorBoxLayerKernel.cpp index 6757affae8..3d89933377 100644 --- a/src/core/NEON/kernels/NEPriorBoxLayerKernel.cpp +++ b/src/core/NEON/kernels/NEPriorBoxLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -209,11 +209,8 @@ void NEPriorBoxLayerKernel::configure(const ITensor *input1, const ITensor *inpu _output = output; // Configure kernel window - const int num_priors = info.aspect_ratios().size() * info.min_sizes().size() + info.max_sizes().size(); - Window win = calculate_max_window(*output->info(), Steps(num_priors * 4)); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + const int num_priors = info.aspect_ratios().size() * info.min_sizes().size() + info.max_sizes().size(); + Window win = calculate_max_window(*output->info(), Steps(num_priors * 4)); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.cpp b/src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.cpp index 8c1c8cf56b..a88b193b31 100644 --- a/src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.cpp +++ b/src/core/NEON/kernels/NEQLSTMLayerNormalizationKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Arm Limited. + * Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -117,10 +117,7 @@ void NEQLSTMLayerNormalizationKernel::configure(const ITensor *input, ITensor *o Window NEQLSTMLayerNormalizationKernel::configure_window(ITensor *target) { - Window window = calculate_max_window(*target->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(target->info()->num_dimensions()); - target->info()->set_valid_region(ValidRegion(coord, target->info()->tensor_shape())); + Window window = calculate_max_window(*target->info(), Steps()); _window_start_x = static_cast(window.x().start()); _window_end_x = static_cast(window.x().end()); diff --git a/src/core/NEON/kernels/NEQuantizationLayerKernel.cpp b/src/core/NEON/kernels/NEQuantizationLayerKernel.cpp index ff3d9fff96..6beb69f30b 100644 --- a/src/core/NEON/kernels/NEQuantizationLayerKernel.cpp +++ b/src/core/NEON/kernels/NEQuantizationLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -153,10 +153,6 @@ void NEQuantizationLayerKernel::configure(const ITensor *input, ITensor *output) // Configure kernel window Window win_config = calculate_max_window(*input->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - INEKernel::configure(win_config); } diff --git a/src/core/NEON/kernels/NEROIAlignLayerKernel.cpp b/src/core/NEON/kernels/NEROIAlignLayerKernel.cpp index e937dadba7..628dd86353 100644 --- a/src/core/NEON/kernels/NEROIAlignLayerKernel.cpp +++ b/src/core/NEON/kernels/NEROIAlignLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -96,10 +96,6 @@ void NEROIAlignLayerKernel::configure(const ITensor *input, const ITensor *rois, window.set(Window::DimX, Window::Dimension(0, num_rois)); window.set(Window::DimY, Window::Dimension(0, 1)); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - // Set instance variables _input = input; _rois = rois; diff --git a/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp index 40dae828a3..9a3a757f1c 100644 --- a/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp +++ b/src/core/NEON/kernels/NEROIPoolingLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -79,10 +79,6 @@ void NEROIPoolingLayerKernel::configure(const ITensor *input, const ITensor *roi window.set(Window::DimX, Window::Dimension(0, rois->info()->dimension(1))); window.set(Window::DimY, Window::Dimension(0, 1)); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - INEKernel::configure(window); } diff --git a/src/core/NEON/kernels/NERangeKernel.cpp b/src/core/NEON/kernels/NERangeKernel.cpp index f62c868dff..170f58fd7a 100644 --- a/src/core/NEON/kernels/NERangeKernel.cpp +++ b/src/core/NEON/kernels/NERangeKernel.cpp @@ -126,10 +126,7 @@ void NERangeKernel::configure(ITensor *output, float start, float end, float ste auto_init_if_empty(*output->info(), TensorShape(num_of_elements_in_range(start, end, step)), 1, output->info()->data_type(), output->info()->quantization_info()); // Configure kernel window - Window win = calculate_max_window(*output->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + Window win = calculate_max_window(*output->info(), Steps()); _start = start; _end = end; diff --git a/src/core/NEON/kernels/NEReductionOperationKernel.cpp b/src/core/NEON/kernels/NEReductionOperationKernel.cpp index 001025bdf5..a449fdee98 100644 --- a/src/core/NEON/kernels/NEReductionOperationKernel.cpp +++ b/src/core/NEON/kernels/NEReductionOperationKernel.cpp @@ -1669,9 +1669,6 @@ void NEReductionOperationKernel::configure(const ITensor *input, ITensor *output _reduction_axis = axis; // Configure kernel window - Coordinates coord; - coord.set_num_dimensions(input->info()->num_dimensions()); - input->info()->set_valid_region(ValidRegion(coord, input->info()->tensor_shape())); Window win = calculate_max_window(*input->info(), Steps()); INEKernel::configure(win); @@ -1681,7 +1678,6 @@ void NEReductionOperationKernel::configure(const ITensor *input, ITensor *output const bool is_arg_min_max = (op == ReductionOperation::ARG_IDX_MIN || op == ReductionOperation::ARG_IDX_MAX); DataType output_data_type = is_arg_min_max ? DataType::S32 : input->info()->data_type(); auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(output_shape).set_data_type(output_data_type).reset_padding().set_is_resizable(true)); - output->info()->set_valid_region(ValidRegion(coord, output_shape)); } Status NEReductionOperationKernel::validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op) diff --git a/src/core/NEON/kernels/NEReorgLayerKernel.cpp b/src/core/NEON/kernels/NEReorgLayerKernel.cpp index 215debe10f..75a58fccd6 100644 --- a/src/core/NEON/kernels/NEReorgLayerKernel.cpp +++ b/src/core/NEON/kernels/NEReorgLayerKernel.cpp @@ -86,7 +86,6 @@ void NEReorgLayerKernel::configure(const ITensor *input, ITensor *output, int32_ _stride = stride; // The NEReorgLayerKernel doesn't need padding so update_window_and_padding() can be skipped - output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape())); // Configure kernel window Window win = calculate_max_window(*output->info(), Steps()); diff --git a/src/core/NEON/kernels/NEScaleKernel.cpp b/src/core/NEON/kernels/NEScaleKernel.cpp index f2c11b203c..6b9aa51aaa 100644 --- a/src/core/NEON/kernels/NEScaleKernel.cpp +++ b/src/core/NEON/kernels/NEScaleKernel.cpp @@ -281,10 +281,7 @@ void NEScaleKernel::configure(const ITensor *input, const ITensor *dx, const ITe } // Configure window - Window win = calculate_max_window(*output->info(), Steps()); - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + Window win = calculate_max_window(*output->info(), Steps()); INEKernel::configure(win); } diff --git a/src/core/NEON/kernels/NEStridedSliceKernel.cpp b/src/core/NEON/kernels/NEStridedSliceKernel.cpp index ac04a1076d..876368c034 100644 --- a/src/core/NEON/kernels/NEStridedSliceKernel.cpp +++ b/src/core/NEON/kernels/NEStridedSliceKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -84,7 +84,6 @@ std::pair validate_and_configure_window(const ITensorInfo *input // Create window Window win = calculate_max_window(*output, Steps()); - output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape())); return std::make_pair(Status{}, win); } diff --git a/src/core/NEON/kernels/NETransposeKernel.cpp b/src/core/NEON/kernels/NETransposeKernel.cpp index 980d90b476..cd4ae52873 100644 --- a/src/core/NEON/kernels/NETransposeKernel.cpp +++ b/src/core/NEON/kernels/NETransposeKernel.cpp @@ -494,11 +494,6 @@ void NETransposeKernel::configure(const ITensor *input, ITensor *output) break; } - // Configure kernel window - Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); - // Note: This kernel performs 16 elements per iteration. // However, since we use a left-over for loop on both dimensions (X and Y), we cannot have any read or write out of memory // For this reason num_elems_processed_per_iteration_x is set to 1 diff --git a/src/core/NEON/kernels/NEWeightsReshapeKernel.cpp b/src/core/NEON/kernels/NEWeightsReshapeKernel.cpp index 109652fb97..44d60093f0 100644 --- a/src/core/NEON/kernels/NEWeightsReshapeKernel.cpp +++ b/src/core/NEON/kernels/NEWeightsReshapeKernel.cpp @@ -71,7 +71,7 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *biases, c return Status{}; } -std::pair validate_and_configure_window(ITensorInfo *input, ITensorInfo *output) +std::pair validate_and_configure_window(ITensorInfo *input) { Window window = calculate_max_window(*input, Steps()); window.set(Window::DimX, Window::Dimension(0, input->dimension(0), input->dimension(0))); @@ -79,7 +79,6 @@ std::pair validate_and_configure_window(ITensorInfo *input, ITen window.set(Window::DimZ, Window::Dimension(0, input->dimension(2), input->dimension(2))); // The NEConvolutionLayerWeightsReshapeKernel doesn't need padding so update_window_and_padding() can be skipped - output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape())); return std::make_pair(Status{}, window); } @@ -107,7 +106,7 @@ void NEWeightsReshapeKernel::configure(const ITensor *input, const ITensor *bias _output = output; // Configure kernel - auto win_config = validate_and_configure_window(input->info(), output->info()); + auto win_config = validate_and_configure_window(input->info()); ARM_COMPUTE_ERROR_THROW_ON(win_config.first); INEKernel::configure(win_config.second); } @@ -115,7 +114,7 @@ void NEWeightsReshapeKernel::configure(const ITensor *input, const ITensor *bias Status NEWeightsReshapeKernel::validate(const ITensorInfo *input, const ITensorInfo *biases, const ITensorInfo *output) { ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, biases, output)); - ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), output->clone().get()).first); + ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get()).first); return Status{}; } diff --git a/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp b/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp index f5a0b370ab..249d5c57d1 100644 --- a/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp +++ b/src/core/NEON/kernels/NEWinogradConvolutionLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -496,7 +496,6 @@ void NEWinogradLayerTransformOutputKernelget_window(); win.set(Window::DimX, Window::Dimension(0, win_last, 1)); - _output_nhwc->info()->set_valid_region(ValidRegion(Coordinates(), _output_nhwc->info()->tensor_shape())); INEKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuActivationKernel.cpp b/src/core/cpu/kernels/CpuActivationKernel.cpp index efdb42b8a5..761258941d 100644 --- a/src/core/cpu/kernels/CpuActivationKernel.cpp +++ b/src/core/cpu/kernels/CpuActivationKernel.cpp @@ -197,10 +197,6 @@ std::pair validate_and_configure_window(const ITensorInfo *src, { // dst auto inizialitation if not yet initialized auto_init_if_empty(*dst, *src->clone()); - - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); } return std::make_pair(Status{}, win); diff --git a/src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp b/src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp index 48eac13041..bd6d777572 100644 --- a/src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp +++ b/src/core/cpu/kernels/CpuConcatenateBatchKernel.cpp @@ -183,10 +183,7 @@ void CpuConcatenateBatchKernel::configure(const ITensorInfo *src, unsigned int b } // Configure kernel window - Window win = calculate_max_window(*dst, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*dst, Steps()); ICpuKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp b/src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp index f64c282ae4..d8eed44cd8 100644 --- a/src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp +++ b/src/core/cpu/kernels/CpuConcatenateDepthKernel.cpp @@ -179,11 +179,7 @@ void CpuConcatenateDepthKernel::configure(const ITensorInfo *src, unsigned int d } // Configure kernel window - Window win = calculate_max_window(*dst, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*dst, Steps()); ICpuKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp b/src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp index c6e224970a..4dc458a4a8 100644 --- a/src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp +++ b/src/core/cpu/kernels/CpuConcatenateHeightKernel.cpp @@ -77,10 +77,7 @@ void CpuConcatenateHeightKernel::configure(const ITensorInfo *src, unsigned int _height_offset = height_offset; // Configure kernel window - Window win = calculate_max_window(*dst, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*dst, Steps()); ICpuKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp b/src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp index e707e8d5a4..efefd5d011 100644 --- a/src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp +++ b/src/core/cpu/kernels/CpuConcatenateWidthKernel.cpp @@ -72,14 +72,12 @@ void CpuConcatenateWidthKernel::configure(const ITensorInfo *src, unsigned int w { ARM_COMPUTE_ERROR_ON_NULLPTR(src, dst); ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, width_offset, dst)); + ARM_COMPUTE_UNUSED(dst); _width_offset = width_offset; // Configure kernel window - Window win = calculate_max_window(*src, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*src, Steps()); ICpuKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuFloorKernel.cpp b/src/core/cpu/kernels/CpuFloorKernel.cpp index 6115b69907..c2e9d48ce9 100644 --- a/src/core/cpu/kernels/CpuFloorKernel.cpp +++ b/src/core/cpu/kernels/CpuFloorKernel.cpp @@ -120,10 +120,6 @@ void CpuFloorKernel::configure(const ITensorInfo *src, ITensorInfo *dst) // Configure kernel window const Window win = calculate_max_window(*src, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); - ICPPKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuPermuteKernel.cpp b/src/core/cpu/kernels/CpuPermuteKernel.cpp index e3055f5f4f..7fd38a3ee7 100644 --- a/src/core/cpu/kernels/CpuPermuteKernel.cpp +++ b/src/core/cpu/kernels/CpuPermuteKernel.cpp @@ -256,9 +256,6 @@ void CpuPermuteKernel::configure(const ITensorInfo *src, ITensorInfo *dst, const Window win = calculate_max_window(*src, Steps()); // The NEPermute doesn't need padding so update_window_and_padding() can be skipped - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); ICpuKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuPoolingKernel.cpp b/src/core/cpu/kernels/CpuPoolingKernel.cpp index e159bb40a9..115a3a4c67 100644 --- a/src/core/cpu/kernels/CpuPoolingKernel.cpp +++ b/src/core/cpu/kernels/CpuPoolingKernel.cpp @@ -422,10 +422,7 @@ void CpuPoolingKernel::configure(ITensorInfo *src, ITensorInfo *dst, const Pooli if(_data_layout == DataLayout::NHWC) { // Configure kernel window - Window win = calculate_max_window(*dst, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*dst, Steps()); ICpuKernel::configure(win); } else diff --git a/src/core/cpu/kernels/CpuReshapeKernel.cpp b/src/core/cpu/kernels/CpuReshapeKernel.cpp index 41ff8bd390..4ab1612518 100644 --- a/src/core/cpu/kernels/CpuReshapeKernel.cpp +++ b/src/core/cpu/kernels/CpuReshapeKernel.cpp @@ -82,13 +82,11 @@ void CpuReshapeKernel::configure(const ITensorInfo *src, ITensorInfo *dst) { ARM_COMPUTE_ERROR_ON_NULLPTR(src, dst); ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, dst)); + ARM_COMPUTE_UNUSED(dst); // Configure kernel window Window win = calculate_max_window(*src); - // Set the destination valid region - dst->set_valid_region(ValidRegion(Coordinates(), dst->tensor_shape())); - ICpuKernel::configure(win); } diff --git a/src/core/cpu/kernels/CpuSoftmaxKernel.cpp b/src/core/cpu/kernels/CpuSoftmaxKernel.cpp index a8542b6be1..d2453ed21d 100644 --- a/src/core/cpu/kernels/CpuSoftmaxKernel.cpp +++ b/src/core/cpu/kernels/CpuSoftmaxKernel.cpp @@ -228,10 +228,7 @@ void CpuLogits1DMaxKernel::configure(const ITensorInfo *src, ITensorInfo *dst) // Output auto initialization if not yet initialized auto_init_if_empty(*dst, output_shape, 1, src->data_type(), src->quantization_info()); - Window win = calculate_max_window(*src, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*src, Steps()); ICpuKernel::configure(win); } @@ -330,10 +327,7 @@ void CpuLogits1DSoftmaxKernel::configure(const ITensorInfo *src, const I auto_init_if_empty(*tmp, TensorInfo(*src).set_data_type(tmp_data_type).reset_padding()); // Configure kernel window - Window win = calculate_max_window(*max, Steps()); - Coordinates coord; - coord.set_num_dimensions(dst->num_dimensions()); - dst->set_valid_region(ValidRegion(coord, dst->tensor_shape())); + Window win = calculate_max_window(*max, Steps()); ICpuKernel::configure(win); } -- cgit v1.2.1