diff options
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLCropResize.h')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLCropResize.h | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/arm_compute/runtime/CL/functions/CLCropResize.h b/arm_compute/runtime/CL/functions/CLCropResize.h index ea50fe51c7..6fb055e893 100644 --- a/arm_compute/runtime/CL/functions/CLCropResize.h +++ b/arm_compute/runtime/CL/functions/CLCropResize.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 ARM Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,10 +25,10 @@ #define ARM_COMPUTE_CL_CROP_RESIZE_H #include "arm_compute/core/CL/ICLTensor.h" -#include "arm_compute/core/CL/kernels/CLCopyKernel.h" -#include "arm_compute/core/CL/kernels/CLCropKernel.h" -#include "arm_compute/core/CL/kernels/CLMemsetKernel.h" #include "arm_compute/runtime/CL/CLTensor.h" +#include "arm_compute/runtime/CL/functions/CLCopy.h" +#include "arm_compute/runtime/CL/functions/CLCrop.h" +#include "arm_compute/runtime/CL/functions/CLFill.h" #include "arm_compute/runtime/CL/functions/CLScale.h" #include <cstdint> @@ -37,7 +37,9 @@ namespace arm_compute { // Forward Declarations +class CLCompileContext; class ITensor; +class ITensorInfo; /** Function to perform cropping and resizing */ class CLCropResize : public IFunction @@ -54,10 +56,18 @@ public: /** Allow instances of this class to be moved */ CLCropResize &operator=(CLCropResize &&) = default; /** Default destructor */ - virtual ~CLCropResize() = default; + ~CLCropResize(); /** Configure kernel * + * Valid data layouts: + * - NHWC + * + * Valid data type configurations: + * |src0 |src1 |src2 |dst | + * |:--------|:--------|:------|:--------| + * |All |F32 |F32 |F32 | + * * @note Supported tensor rank: up to 4 * @note Box indices may be outside of the bounds, in which case @p extrapolation_value is used. * @note Start and end indices of boxes are inclusive. @@ -71,8 +81,13 @@ public: * @param[in] method The policy to be used when resizing image. Default is bilinear. * @param[in] extrapolation_value Value to be used for values outside of the image for cropping and resizing. Default is 0. */ - void configure(const ICLTensor *input, ICLTensor *boxes, ICLTensor *box_ind, ICLTensor *output, Coordinates2D crop_size, - InterpolationPolicy method = InterpolationPolicy::BILINEAR, float extrapolation_value = 0); + void configure(const ICLTensor *input, + ICLTensor *boxes, + ICLTensor *box_ind, + ICLTensor *output, + Coordinates2D crop_size, + InterpolationPolicy method = InterpolationPolicy::BILINEAR, + float extrapolation_value = 0); /** Configure kernel * * @note Supported tensor rank: up to 4 @@ -89,8 +104,14 @@ public: * @param[in] method The policy to be used when resizing image. Default is bilinear. * @param[in] extrapolation_value Value to be used for values outside of the image for cropping and resizing. Default is 0. */ - void configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *boxes, ICLTensor *box_ind, ICLTensor *output, Coordinates2D crop_size, - InterpolationPolicy method = InterpolationPolicy::BILINEAR, float extrapolation_value = 0); + void configure(const CLCompileContext &compile_context, + const ICLTensor *input, + ICLTensor *boxes, + ICLTensor *box_ind, + ICLTensor *output, + Coordinates2D crop_size, + InterpolationPolicy method = InterpolationPolicy::BILINEAR, + float extrapolation_value = 0); /** Static function to check if given info will lead to a valid configuration of @ref NESlice * @@ -110,8 +131,13 @@ public: * * @return A status */ - static Status validate(const ITensorInfo *input, ITensorInfo *boxes, ITensorInfo *box_ind, const ITensorInfo *output, - Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value); + static Status validate(const ITensorInfo *input, + ITensorInfo *boxes, + ITensorInfo *box_ind, + const ITensorInfo *output, + Coordinates2D crop_size, + InterpolationPolicy method, + float extrapolation_value); void run() override; @@ -123,12 +149,12 @@ public: InterpolationPolicy _method; float _extrapolation_value; - std::vector<std::unique_ptr<CLScale>> _scale; - std::vector<std::unique_ptr<CLCopyKernel>> _copy; - std::vector<std::unique_ptr<CLTensor>> _crop_results; - std::vector<std::unique_ptr<CLTensor>> _scaled_results; + std::vector<std::unique_ptr<CLScale>> _scale; + std::vector<std::unique_ptr<CLCopy>> _copy; + std::vector<std::unique_ptr<CLTensor>> _crop_results; + std::vector<std::unique_ptr<CLTensor>> _scaled_results; - std::vector<std::unique_ptr<ICLKernel>> _internal_kernels; + std::vector<std::unique_ptr<IFunction>> _internal_functions; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CL_CROP_RESIZE_H */ |