21.02
|
Neon kernel to perform scaling on a tensor. More...
#include <NEScaleKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NEScaleKernel () | |
Default constructor. More... | |
NEScaleKernel (const NEScaleKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEScaleKernel & | operator= (const NEScaleKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEScaleKernel (NEScaleKernel &&)=default | |
Allow instances of this class to be moved. More... | |
NEScaleKernel & | operator= (NEScaleKernel &&)=default |
Allow instances of this class to be moved. More... | |
~NEScaleKernel ()=default | |
Default destructor. More... | |
void | configure (const ITensor *input, const ITensor *dx, const ITensor *dy, const ITensor *offsets, ITensor *output, const ScaleKernelInfo &info) |
Initialise the kernel's inputs, output and interpolation policy. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
virtual void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *dx, const ITensorInfo *dy, const ITensorInfo *offsets, ITensorInfo *output, const ScaleKernelInfo &info) |
Static function to check if given info will lead to a valid configuration of NEScaleKernel. More... | |
Neon kernel to perform scaling on a tensor.
Definition at line 35 of file NEScaleKernel.h.
NEScaleKernel | ( | ) |
Default constructor.
Definition at line 193 of file NEScaleKernel.cpp.
Referenced by NEScaleKernel::name().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
default |
Default destructor.
Referenced by NEScaleKernel::name().
void configure | ( | const ITensor * | input, |
const ITensor * | dx, | ||
const ITensor * | dy, | ||
const ITensor * | offsets, | ||
ITensor * | output, | ||
const ScaleKernelInfo & | info | ||
) |
Initialise the kernel's inputs, output and interpolation policy.
policy
Area only supports data layout NCHW and input data type U8.[in] | input | Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/U8/S16/F16/F32. |
[in] | dx | Pixel's distance between the X real coordinate and the smallest X following integer. Data type supported: F32 |
[in] | dy | Pixel's distance between the Y real coordinate and the smallest Y following integer. Data type supported: F32 |
[in] | offsets | Offset to access the pixel with NEAREST interpolation or the top-left pixel with BILINEAR interpolation in the input tensor. Data type supported: S32. |
[out] | output | Destination tensor. Data types supported: Same as input . All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane. |
[in] | info | ScaleKernelInfo to use for configuration |
Definition at line 199 of file NEScaleKernel.cpp.
References ScaleKernelInfo::align_corners, arm_compute::AREA, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ScaleKernelInfo::border_mode, arm_compute::calculate_max_window(), arm_compute::scale_utils::calculate_resize_ratio(), arm_compute::CENTER, arm_compute::CONSTANT, ScaleKernelInfo::constant_border_value, ScaleKernelInfo::data_layout, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), Window::DimX, Window::DimY, Window::DimZ, arm_compute::execute_window_loop(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, ITensor::info(), arm_compute::test::validation::info, arm_compute::test::validation::input, ScaleKernelInfo::interpolation_policy, BorderSize::left, arm_compute::NCHW, arm_compute::NEAREST_NEIGHBOR, ITensorInfo::num_dimensions(), ITensorInfo::padding(), Iterator::ptr(), BorderSize::right, arm_compute::utils::rounding::round_half_away_from_zero(), ScaleKernelInfo::sampling_policy, Window::set(), Dimensions< T >::set_num_dimensions(), ITensorInfo::set_valid_region(), arm_compute::string_from_data_layout(), arm_compute::string_from_data_type(), arm_compute::string_from_interpolation_policy(), ITensorInfo::tensor_shape(), arm_compute::UNDEFINED, arm_compute::UNKNOWN, arm_compute::validate_arguments(), arm_compute::WIDTH, IKernel::window(), Window::x(), and Window::y().
Referenced by NEScaleKernel::name().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 38 of file NEScaleKernel.h.
References NEScaleKernel::configure(), arm_compute::test::validation::info, arm_compute::test::validation::input, NEScaleKernel::NEScaleKernel(), NEScaleKernel::operator=(), NEScaleKernel::run(), NEScaleKernel::validate(), IKernel::window(), and NEScaleKernel::~NEScaleKernel().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by NEScaleKernel::name().
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 583 of file NEScaleKernel.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, arm_compute::NCHW, and IKernel::window().
Referenced by NEScaleKernel::name().
|
static |
Static function to check if given info will lead to a valid configuration of NEScaleKernel.
policy
Area only supports data layout NCHW and input data type U8.[in] | input | Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/U8/S16/F16/F32. |
[in] | dx | Pixel's distance between the X real coordinate and the smallest X following integer. Data type supported: F32 |
[in] | dy | Pixel's distance between the Y real coordinate and the smallest Y following integer. Data type supported: F32 |
[in] | offsets | Offset to access the pixel with NEAREST interpolation or the top-left pixel with BILINEAR interpolation in the input tensor. Data type supported: S32. |
[in] | output | Destination tensor. Data types supported: Same as input . All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane. |
[in] | info | ScaleKernelInfo to use for validation |
Definition at line 576 of file NEScaleKernel.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::validate_arguments().
Referenced by NEScaleKernel::name(), and NEScale::validate().