46 if(output->total_size() != 0)
55 std::pair<Status, Window> validate_and_configure_window(ITensorInfo *
input, ITensorInfo *output)
61 const UniformQuantizationInfo
qinfo =
input->quantization_info().uniform();
62 const int offset_correction = is_input_signed ? -128 : 128;
63 const QuantizationInfo corrected_qinfo = QuantizationInfo(
qinfo.
scale,
qinfo.
offset + offset_correction);
73 : _input(nullptr), _output(nullptr)
85 std::pair<Status, Window> win_config = validate_and_configure_window(
input->info(), output->
info());
87 INEKernel::configure(win_config.second);
107 Iterator output(_output, win_collapsed);
109 const int window_step_x = 16;
110 const auto window_start_x = static_cast<int>(
window.
x().
start());
111 const auto window_end_x = static_cast<int>(
window.
x().
end());
113 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;
const std::vector< int32_t > & offset() const
Offset vector accessor.
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.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
uint8x16_t vloadq(const uint8_t *ptr)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
NEConvertQuantizedSignednessKernel()
Default constructor.
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.
Interface for CPU tensor.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
Copyright (c) 2017-2021 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of NEConvertQuantizedSigned...
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
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.
quantized, asymmetric fixed-point 8-bit number unsigned
uint8x8_t veor(const uint8x8_t &a, const uint8x8_t &b)
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 std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
const std::vector< float > & scale() const
Scale vector accessor.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
const QuantizationInfo qinfo
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const GEMMLowpOutputStageInfo *output_stage)
void vstore(uint8_t *ptr, uint8x8_t val)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
void configure(const ITensor *input, ITensor *output)
Initialize the kernel's input, output.
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)
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...
quantized, asymmetric fixed-point 8-bit number signed
Includes all wrapper headers at once.
constexpr int end() const
Return the end of the dimension.
Iterator updated by execute_window_loop for each window element.
DataType
Available data types.
constexpr int start() const
Return the start of the dimension.
Describe a multidimensional execution window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
constexpr const Dimension & x() const
Alias to access the first dimension of the window.