24.02.1
|
Go to the documentation of this file.
59 void CPPPermuteKernel::run_permute(
const Window &window)
71 window_out.set(d, zero_window);
84 const int idx =
id[0] * perm_strides[0] +
id[1] * perm_strides[1] +
id[2] * perm_strides[2];
85 *(
reinterpret_cast<T *
>(out.ptr() + idx)) = *(
reinterpret_cast<const T *
>(in.ptr()));
95 const int idx =
id[0] * perm_strides[0] +
id[1] * perm_strides[1] +
id[2] * perm_strides[2] +
96 id[3] * perm_strides[3];
97 *(
reinterpret_cast<T *
>(out.ptr() + idx)) = *(
reinterpret_cast<const T *
>(in.ptr()));
121 switch (
input->info()->element_size())
124 _func = &CPPPermuteKernel::run_permute<uint8_t>;
127 _func = &CPPPermuteKernel::run_permute<uint16_t>;
130 _func = &CPPPermuteKernel::run_permute<uint32_t>;
145 ICPPKernel::configure(win);
160 if (_func !=
nullptr)
Class to describe a number of elements in each dimension.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
TensorShape compute_permutation_output_shape(const ITensorInfo &input, const PermutationVector &perm)
Calculate the permuted shape of an input given a permutation vector.
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
void permute_strides(Dimensions< T > &dimensions, const PermutationVector &perm)
Permutes the given dimensions according the permutation vector.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Interface for CPU tensor.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Strides of an item in bytes.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Iterator updated by execute_window_loop for each window element.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
Container for valid region of a window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Describe one of the image's dimensions with a start, end and step.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
Describe a multidimensional execution window.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
virtual void set_valid_region(const ValidRegion &valid_region)=0
Set the valid region of the tensor.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
CPPPermuteKernel()
Default constructor.
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
Store the tensor's metadata.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
void configure(const ITensor *input, ITensor *output, const PermutationVector &perm)
Set the input and output of the kernel.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PermutationVector &perm)
Static function to check if given info will lead to a valid configuration of CPPPermuteKernel.
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)