24.02.1
|
Go to the documentation of this file.
55 ICPPKernel::configure(win);
64 if (
dst->total_size() != 0)
93 const size_t window_start_x = window.
x().
start();
94 const size_t window_end_x = window.
x().
end();
96 const size_t in_height =
src->info()->dimension(1);
97 const size_t in_stride =
src->info()->strides_in_bytes()[1];
99 const size_t partial_y = in_height % 4;
101 const size_t element_size =
src->info()->element_size();
119 if (
id.y() + 4 <=
static_cast<int>(in_height))
121 for (
size_t x = window_start_x; x < window_end_x; ++x)
123 std::memcpy(out.
ptr() + (x * 4 + 0) * element_size, (in.
ptr() + 0 * in_stride) + x * element_size,
125 std::memcpy(out.
ptr() + (x * 4 + 1) * element_size, (in.
ptr() + 1 * in_stride) + x * element_size,
127 std::memcpy(out.
ptr() + (x * 4 + 2) * element_size, (in.
ptr() + 2 * in_stride) + x * element_size,
129 std::memcpy(out.
ptr() + (x * 4 + 3) * element_size, (in.
ptr() + 3 * in_stride) + x * element_size,
135 for (
size_t x = window_start_x; x < window_end_x; ++x)
138 for (; y < partial_y; ++y)
140 std::memcpy(out.
ptr() + (x * 4 + y) * element_size,
141 (in.
ptr() + y * in_stride) + x * element_size, element_size);
145 std::memset(out.
ptr() + (x * 4 + y) * element_size, 0, element_size);
155 return "CpuGemmInterleave4x4Kernel";
Class to describe a number of elements in each dimension.
constexpr int start() const
Return the start of the dimension.
SimpleTensor< float > src
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
void scale(size_t dimension, float scale_value)
Scale the values of a given dimension by the given scale_value.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Interface for CPU tensor.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
bool empty() const
Checks if pack is empty.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
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.
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#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...
#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.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
const char * name() const override
Name of the kernel.
const Window & window() const
The maximum window the kernel can be executed on.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
Information about executing thread and CPU.
Describe a multidimensional execution window.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration of CpuGemmInterleave4x4Kern...
Copyright (c) 2017-2024 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
void configure(const ITensorInfo *src, ITensorInfo *dst)
Initialise the kernel's src and dst.
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
constexpr int end() const
Return the end of the dimension.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.