diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2021-03-19 15:06:07 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-03-29 19:48:22 +0000 |
commit | 702dc0c71f2b2830b63e3b4079ede0ef76377f0a (patch) | |
tree | afb0dacd74a8650350802aea8043822503c2f8b2 /src/core/CL/kernels/CLStridedSliceKernel.cpp | |
parent | 26c5c0fc10cbee1b523af0b27f884719dc50820a (diff) | |
download | ComputeLibrary-702dc0c71f2b2830b63e3b4079ede0ef76377f0a.tar.gz |
Remove usage of valid window region CL - NHWC
Resolves: COMPMID-4153
Change-Id: Ib0d60c9acaac8aaf3946c62fc2d740b5ec6cee5c
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5301
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLStridedSliceKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLStridedSliceKernel.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/src/core/CL/kernels/CLStridedSliceKernel.cpp b/src/core/CL/kernels/CLStridedSliceKernel.cpp index 75fd01df14..dd51df9363 100644 --- a/src/core/CL/kernels/CLStridedSliceKernel.cpp +++ b/src/core/CL/kernels/CLStridedSliceKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -68,23 +68,6 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, return Status{}; } - -std::pair<Status, Window> validate_and_configure_window(const ITensorInfo *input, ITensorInfo *output, - const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, - int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask) -{ - // Output tensor auto initialization if not yet initialized - const TensorShape output_shape = arm_compute::misc::shape_calculator::compute_strided_slice_shape(*input, - starts, ends, strides, - begin_mask, end_mask, shrink_axis_mask); - auto_init_if_empty(*output, input->clone()->set_tensor_shape(output_shape)); - - // Create window - Window win = calculate_max_window(*output, Steps()); - output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape())); - - return std::make_pair(Status{}, win); -} } // namespace void CLStridedSliceKernel::configure(const CLCompileContext &compile_context, const ITensorInfo *input, ITensorInfo *output, @@ -106,8 +89,11 @@ void CLStridedSliceKernel::configure(const CLCompileContext &compile_context, co begin_mask, end_mask, shrink_axis_mask); // Configure kernel window - auto win_config = validate_and_configure_window(input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask); - ARM_COMPUTE_ERROR_THROW_ON(win_config.first); + const TensorShape output_shape = arm_compute::misc::shape_calculator::compute_strided_slice_shape(*input, + starts, ends, strides, + begin_mask, end_mask, shrink_axis_mask); + auto_init_if_empty(*output, input->clone()->set_tensor_shape(output_shape)); + Window win = calculate_max_window(*output, Steps()); // Enable multiple elements processing along x if stride_x is 1 and output width greater than the access vector size const int vec_size_x = 16 / input->element_size(); @@ -118,11 +104,11 @@ void CLStridedSliceKernel::configure(const CLCompileContext &compile_context, co // Update window if needed if(multi_access_x) { - Window &updated_window = std::get<1>(win_config); + Window &updated_window = win; updated_window.set(Window::DimX, Window::Dimension(updated_window.x().start(), ceil_to_multiple(updated_window.x().end(), vec_size_x), vec_size_x)); } - ICLKernel::configure_internal(win_config.second); + ICLKernel::configure_internal(win); // Create build options CLBuildOptions build_opts; @@ -169,9 +155,6 @@ Status CLStridedSliceKernel::validate(const ITensorInfo *input, const ITensorInf int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask) { ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask)); - ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), output->clone().get(), - starts, ends, strides, begin_mask, end_mask, shrink_axis_mask) - .first); return Status{}; } |