24.02.1
|
Go to the documentation of this file.
51 void depth_concat(
const ITensor *
src, ITensor *
dst,
unsigned int depth_offset,
const Window &window)
54 uint8_t *src_ptr =
src->buffer() +
src->info()->offset_first_element_in_bytes();
57 uint8_t *dst_ptr =
dst->buffer() +
dst->info()->offset_first_element_in_bytes() +
58 depth_offset *
dst->info()->strides_in_bytes()[2];
60 const auto window_start_x =
static_cast<int>(window.x().start());
61 const auto window_end_x =
static_cast<int>(window.x().end());
62 const int window_step_x = 16 /
dst->info()->element_size();
66 win.set(
Window::DimZ, Window::Dimension(0,
src->info()->tensor_shape().z(), 1));
68 Iterator src_it(
src, win);
69 Iterator dst_it(
dst, win);
72 const UniformQuantizationInfo src_qinfo =
src->info()->quantization_info().uniform();
73 const UniformQuantizationInfo dst_qinfo =
dst->info()->quantization_info().uniform();
78 [&](
const Coordinates &)
80 const auto in_ptr =
reinterpret_cast<const uint8_t *
>(src_ptr + src_it.offset());
81 const auto out_ptr =
reinterpret_cast<uint8_t *
>(dst_ptr + dst_it.offset());
82 int x = window_start_x;
83 for (; x <= (window_end_x - window_step_x); x += window_step_x)
90 for (; x < window_end_x; ++x)
101 [&](
const Coordinates &)
103 const auto in_ptr =
reinterpret_cast<const int8_t *
>(src_ptr + src_it.offset());
104 const auto out_ptr =
reinterpret_cast<int8_t *
>(dst_ptr + dst_it.offset());
105 int x = window_start_x;
106 for (; x <= (window_end_x - window_step_x); x += window_step_x)
113 for (; x < window_end_x; ++x)
125 [&](
const Coordinates &)
127 const auto in_ptr =
reinterpret_cast<const T *
>(src_ptr + src_it.offset());
128 const auto out_ptr =
reinterpret_cast<T *
>(dst_ptr + dst_it.offset());
129 int x = window_start_x;
130 for (; x <= (window_end_x - window_step_x); x += window_step_x)
135 for (; x < window_end_x; ++x)
137 *(out_ptr + x) = *(in_ptr + x);
167 _depth_offset = depth_offset;
169 switch (
src->data_type())
172 _func = &depth_concat<uint8_t>;
175 _func = &depth_concat<int8_t>;
178 _func = &depth_concat<uint16_t>;
181 _func = &depth_concat<uint32_t>;
189 ICpuKernel::configure(win);
193 unsigned int depth_offset,
213 return "CpuConcatenateDepthKernel";
Class to describe a number of elements in each dimension.
float32x4x2_t vdequantize(const uint8x8_t &qv, const UniformQuantizationInfo &qi)
Dequantize a neon vector holding 8 quantized values.
float dequantize_qasymm8(uint8_t value, const INFO_TYPE &qinfo)
Dequantize a value given an unsigned 8-bit asymmetric quantization scheme.
SimpleTensor< float > src
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
uint8_t quantize_qasymm8(float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given an unsigned 8-bit asymmetric quantization scheme.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
uint8x16_t vloadq(const uint8_t *ptr)
Includes all wrapper headers at once.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
static Status validate(const ITensorInfo *src, unsigned int depth_offset, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
#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.
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...
int8_t quantize_qasymm8_signed(float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a signed 8-bit asymmetric quantization scheme.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
const char * name() const override
Name of the kernel.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
void vstore(uint8_t *ptr, uint8x8_t val)
Describe a multidimensional execution window.
float dequantize_qasymm8_signed(int8_t value, const INFO_TYPE &qinfo)
Dequantize a value given a signed 8-bit asymmetric quantization scheme.
uint8x8_t vquantize(const float32x4x2_t &qv, const UniformQuantizationInfo &qi)
Quantize a neon vector holding 8 floating point values.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Store the tensor's metadata.
@ F32
32-bit floating-point number
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
int8x8_t vquantize_signed(const float32x4x2_t &qv, const UniformQuantizationInfo &qi)
Quantize a neon vector holding 8 floating point values.
void configure(const ITensorInfo *src, unsigned int depth_offset, ITensorInfo *dst)
Configure kernel for a given list of arguments.
DataType
Available data types.