23.08
|
Interface for the kernel to perform tensor strided slicing. More...
#include <NEStridedSliceKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NEStridedSliceKernel () | |
Default constructor. More... | |
NEStridedSliceKernel (const NEStridedSliceKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEStridedSliceKernel & | operator= (const NEStridedSliceKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEStridedSliceKernel (NEStridedSliceKernel &&)=default | |
Allow instances of this class to be moved. More... | |
NEStridedSliceKernel & | operator= (NEStridedSliceKernel &&)=default |
Allow instances of this class to be moved. More... | |
~NEStridedSliceKernel ()=default | |
Default destructor. More... | |
void | configure (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) |
Configure kernel. More... | |
void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
![]() | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run (const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. 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 size_t | get_mws (const CPUInfo &platform, size_t thread_count) const |
Return minimum workload size of the relevant kernel. More... | |
![]() | |
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... | |
bool | is_window_configured () const |
Function to check if the embedded window of this kernel has been configured. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask) |
Static function to check if given info will lead to a valid configuration of NEStridedSliceKernel. More... | |
Additional Inherited Members | |
![]() | |
static constexpr size_t | default_mws = 1 |
Interface for the kernel to perform tensor strided slicing.
Definition at line 38 of file NEStridedSliceKernel.h.
Default constructor.
Definition at line 91 of file NEStridedSliceKernel.cpp.
|
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.
void configure | ( | 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 | ||
) |
Configure kernel.
[in] | input | Source tensor info. Data type supported: All |
[out] | output | Destination tensor info. Data type supported: Same as input |
[in] | starts | The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
[in] | ends | The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
[in] | strides | The strides of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
[in] | begin_mask | If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | end_mask | If the ith bit of end_mask is set, ends[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | shrink_axis_mask | If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved. |
Definition at line 96 of file NEStridedSliceKernel.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::helpers::tensor_transform::calculate_strided_slice_coords(), arm_compute::test::validation::input, arm_compute::test::validation::input_shape, arm_compute::cpu::kernels::validate_and_configure_window(), and arm_compute::cpu::kernels::validate_arguments().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 41 of file NEStridedSliceKernel.h.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | tensors | A vector containing the tensors to operate on. |
[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 127 of file NEStridedSliceKernel.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, Window::DimX, arm_compute::execute_window_loop(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), arm_compute::test::validation::info, arm_compute::test::validation::input, arm_compute::helpers::bit_ops::is_bit_set(), Iterator::ptr(), Dimensions< T >::set(), Window::set(), Window::shape(), and IKernel::window().
|
static |
Static function to check if given info will lead to a valid configuration of NEStridedSliceKernel.
[in] | input | Source tensor info. Data type supported: All |
[in] | output | Destination tensor info. Data type supported: Same as input |
[in] | starts | The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
[in] | ends | The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
[in] | strides | The strides of the dimensions of the input tensor to be sliced. The length must be of rank(input). |
[in] | begin_mask | If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | end_mask | If the ith bit of end_mask is set, ends[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | shrink_axis_mask | If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved. |
Definition at line 115 of file NEStridedSliceKernel.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), arm_compute::test::validation::input, arm_compute::cpu::kernels::validate_and_configure_window(), and arm_compute::cpu::kernels::validate_arguments().
Referenced by NESlice::validate(), and NEStridedSlice::validate().