43 constexpr
int window_step_x = 8;
44 const auto window_start_x =
static_cast<int>(window.
x().
start());
45 const auto window_end_x =
static_cast<int>(window.
x().
end());
56 const auto vconst_1 = vdupq_n_f32(1.f);
57 const float32x4_t va_f32 = vdupq_n_f32(act_info.
a());
58 const float32x4_t vb_f32 = vdupq_n_f32(act_info.
b());
59 const float a_f32 = act_info.
a();
60 const float b_f32 = act_info.
b();
64 const auto input_ptr =
reinterpret_cast<const qsymm16_t *
>(input.
ptr());
65 const auto output_ptr =
reinterpret_cast<qsymm16_t *
>(output.
ptr());
71 int x = window_start_x;
72 for(; x <= (window_end_x - window_step_x); x += window_step_x)
80 const float32x4x2_t tmp_dep =
95 const float32x4x2_t tmp_dep =
113 for(; x < window_end_x; ++x)
120 tmp_f = 1.f / (1.f + std::exp(-tmp_f));
126 tmp_f = a_f32 * std::tanh(b_f32 * tmp_f);
133 *(output_ptr + x) = tmp;
float32x2_t vdiv(const float32x2_t &a, const float32x2_t &b)
int16_t quantize_qsymm16(float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a 16-bit symmetric quantization scheme.
float32x4_t vtanh(const float32x4_t &a)
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
float a() const
Get the alpha value.
uint8x16_t vloadq(const uint8_t *ptr)
uint8x8_t vadd(const uint8x8_t &a, const uint8x8_t &b)
float32x4x2_t vdequantize_int16(const int16x8_t &qv, float scale)
Dequantize a neon vector holding 8 16-bit quantized values.
Describe one of the image's dimensions with a start, end and step.
int16x8_t vquantize_int16(const float32x4x2_t &qv, float scale)
Quantize a neon vector holding 8 floating point values.
Activation Layer Information class.
Interface for Neon tensor.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
ActivationFunction
Available activation functions.
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.
float dequantize_qsymm16(int16_t value, const UniformQuantizationInfo &qinfo)
Dequantize a value given a 16-bit symmetric quantization scheme.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
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.
void qsymm16_neon_activation(const ITensor *src, ITensor *dst, const ActivationLayerInfo &act_info, const Window &window)
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
int8x8_t vneg(const int8x8_t &a)
uint8x8_t vmul(const uint8x8_t &a, const uint8x8_t &b)
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
void vstore(uint8_t *ptr, uint8x8_t val)
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...
typename neon_bitvector< T, BW >::type neon_bitvector_t
Helper type template to get the type of a neon vector.
ActivationFunction activation() const
Get the type of activation function.
float b() const
Get the beta value.
Includes all wrapper headers at once.
constexpr int end() const
Return the end of the dimension.
int16_t qsymm16_t
16 bit quantized symmetric scalar value
Iterator updated by execute_window_loop for each window element.
constexpr int start() const
Return the start of the dimension.
float32x4_t vexpq(const float32x4_t &a)
Describe a multidimensional execution window.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.