24.02.1
|
Go to the documentation of this file.
51 if (
dst->total_size() != 0)
66 const UniformQuantizationInfo
qinfo =
src->quantization_info().uniform();
67 const int offset_correction = is_input_signed ? -128 : 128;
68 const QuantizationInfo corrected_qinfo = QuantizationInfo(
qinfo.
scale,
qinfo.
offset + offset_correction);
84 ICpuKernel::configure(win_config.second);
107 const int window_step_x = 16;
108 const auto window_start_x =
static_cast<int>(
window.
x().
start());
109 const auto window_end_x =
static_cast<int>(
window.
x().
end());
111 const uint8_t mask = 128;
118 const auto input_ptr =
reinterpret_cast<const uint8_t *
>(
input.ptr());
119 const auto output_ptr =
reinterpret_cast<uint8_t *
>(output.
ptr());
122 int x = window_start_x;
123 for (; x <= (window_end_x - window_step_x); x += window_step_x)
130 for (; x < window_end_x; ++x)
132 const uint8_t in = *(
reinterpret_cast<const uint8_t *
>(input_ptr + x));
133 *(output_ptr + x) = in ^ mask;
141 return "CpuConvertQuantizedSignednessKernel";
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)
@ 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)
const char * name() const override
Name of the kernel.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
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_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
static Status validate(const ITensorInfo *src, 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(...)
uint8x8_t veor(const uint8x8_t &a, const uint8x8_t &b)
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
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.
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...
const std::vector< float > & scale() const
Scale vector accessor.
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
std::pair< Status, Window > validate_and_configure_window(ITensorInfo *src, ITensorInfo *dst)
#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.
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.
Copyright (c) 2017-2024 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
void configure(const ITensorInfo *src, ITensorInfo *dst)
Initialize the kernel input and output info.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
Store the tensor's metadata.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
constexpr int end() const
Return the end of the dimension.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.
DataType
Available data types.
const QuantizationInfo qinfo
const std::vector< int32_t > & offset() const
Offset vector accessor.
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)