86 switch(
input->info()->element_size())
89 _func = &NEGEMMInterleave4x4Kernel::gemm_interleave4x4<uint8_t>;
92 _func = &NEGEMMInterleave4x4Kernel::gemm_interleave4x4<uint16_t>;
95 _func = &NEGEMMInterleave4x4Kernel::gemm_interleave4x4<uint32_t>;
104 INEKernel::configure(win);
114 template <
typename ScalarType>
120 const size_t in_height =
input->info()->dimension(1);
121 const size_t in_stride =
input->info()->strides_in_bytes()[1];
123 const size_t partial_y = in_height % 4;
139 if(
id.y() + 4 <= static_cast<int>(in_height))
141 for(
size_t x = window_start_x; x < window_end_x; ++x)
143 const ScalarType data[4] =
145 *(reinterpret_cast<const ScalarType *>(in.ptr() + 0 * in_stride) + x),
146 *(reinterpret_cast<const ScalarType *>(in.ptr() + 1 * in_stride) + x),
147 *(reinterpret_cast<const ScalarType *>(in.ptr() + 2 * in_stride) + x),
148 *(reinterpret_cast<const ScalarType *>(in.ptr() + 3 * in_stride) + x),
150 std::memcpy(out.ptr() + x * 4 *
sizeof(ScalarType), data, 4 *
sizeof(ScalarType));
155 for(
size_t x = window_start_x; x < window_end_x; ++x)
157 ScalarType data[4] = { 0, 0, 0, 0 };
159 for(
size_t y = 0; y < partial_y; ++y)
161 data[y] = *(reinterpret_cast<const ScalarType *>(in.ptr() + y * in_stride) + x);
164 std::memcpy(out.ptr() + x * 4 *
sizeof(ScalarType), data, 4 *
sizeof(ScalarType));
186 (this->*_func)(_input, _output,
window);
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const Window & window() const
The maximum window the kernel can be executed on.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Describe one of the image's dimensions with a start, end and step.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Interface for CPU tensor.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
TensorShape compute_interleaved_shape(const ITensorInfo &a, int mult_interleave4x4_height=1, bool reinterpret_input_as_3d=false)
Calculate the interleaved shape of an input tensor.
Copyright (c) 2017-2021 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Class to describe a number of elements in each dimension.
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of NEGEMMInterleave4x4Kerne...
void configure(const ITensor *input, ITensor *output)
Initialise the kernel's input and output.
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...
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const GEMMLowpOutputStageInfo *output_stage)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
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...
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
constexpr int end() const
Return the end of the dimension.
Iterator updated by execute_window_loop for each window element.
constexpr int start() const
Return the start of the dimension.
Describe a multidimensional execution window.
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
NEGEMMInterleave4x4Kernel()
Constructor.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
constexpr const Dimension & x() const
Alias to access the first dimension of the window.