24 #ifndef ARM_COMPUTE_TEST_FIXED_POINT_NEON_TARGET
25 #define ARM_COMPUTE_TEST_FIXED_POINT_NEON_TARGET
40 template <
typename TensorType,
typename AccessorType,
typename T>
41 void compute_target_impl(
const TensorShape &
shape,
DataType dt,
FixedPointOp op,
int fixed_point_position, TensorType &src, TensorType &dst)
49 constexpr
unsigned int num_elems_processed_per_iteration = 16;
51 AccessWindowHorizontal input_access(src.info(), 0, num_elems_processed_per_iteration);
52 AccessWindowHorizontal output_access(dst.info(), 0, num_elems_processed_per_iteration);
57 constexpr
unsigned int num_elems_processed_per_iteration = 8;
59 AccessWindowHorizontal input_access(src.info(), 0, num_elems_processed_per_iteration);
60 AccessWindowHorizontal output_access(dst.info(), 0, num_elems_processed_per_iteration);
76 min = -(1 << (fixed_point_position - 1));
77 max = (1 << (fixed_point_position - 1));
102 min = (1 << (fixed_point_position - 1));
109 min = (1 << (fixed_point_position - 1));
137 std::uniform_int_distribution<> distribution(min, max);
138 library->fill(AccessorType(src), distribution, 0);
140 Iterator input(&src, window);
141 Iterator output(&dst, window);
143 const auto loop_function = [&](
const Coordinates &
id)
149 const qint8x16_t qs8in = vld1q_s8(reinterpret_cast<const qint8_t *>(input.ptr()));
155 vst1q_s8(reinterpret_cast<qint8_t *>(output.ptr()),
vqexpq_qs8(qs8in, fixed_point_position));
160 vst1q_s8(reinterpret_cast<qint8_t *>(output.ptr()),
vqinvsqrtq_qs8(qs8in, fixed_point_position));
165 vst1q_s8(reinterpret_cast<qint8_t *>(output.ptr()),
vlogq_qs8(qs8in, fixed_point_position));
170 vst1q_s8(reinterpret_cast<qint8_t *>(output.ptr()),
vrecipq_qs8(qs8in, fixed_point_position));
197 vst1q_qs16(reinterpret_cast<qint16_t *>(output.ptr()),
vlogq_qs16(qs16in, fixed_point_position));
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)
qint8x16_t vlogq_qs8(qint8x16_t a, int fixed_point_position)
Calculate logarithm fixed point 16bit (16 elements)
FixedPointOp
Fixed point operation.
qint16x8_t vqrecipq_qs16(qint16x8_t a, int fixed_point_position)
int8x16_t qint8x16_t
8 bit fixed point vector with 16 elements
qint16x8_t vqinvsqrtq_qs16(qint16x8_t a, int fixed_point_position)
Calculate saturating inverse square root for fixed point 16 bit using Newton-Raphosn method (8 elemen...
std::unique_ptr< AssetsLibrary > library
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...
qint16x8_t vld1q_qs16(const qint16_t *addr)
Load a single 16 bit fixed point vector from memory (8 elements)
qint8x16_t vqexpq_qs8(qint8x16_t a, int fixed_point_position)
Calculate saturating exponential fixed point 8bit (16 elements)
int16x8_t qint16x8_t
16 bit fixed point vector with 8 elements
qint16x8_t vqexpq_qs16(qint16x8_t a, int fixed_point_position)
Calculate saturating exponential fixed point 16 bit (8 elements)
void vst1q_qs16(qint16_t *addr, qint16x8_t b)
Store a single 16 bit fixed point vector to memory (8 elements)
Window calculate_max_window(const ITensorInfo &info, const Steps &steps=Steps(), bool skip_border=false, BorderSize border_size=BorderSize())
Calculate the maximum window for a given tensor shape and border setting.
qint8x16_t vqinvsqrtq_qs8(qint8x16_t a, int fixed_point_position)
Calculate saturating inverse square root for fixed point 8bit using Newton-Raphosn method (16 element...
fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)
DataType
Available data types.
qint16x8_t vlogq_qs16(qint16x8_t a, int fixed_point_position)
Calculate logarithm fixed point 16 bit (8 elements)
qint8x16_t vrecipq_qs8(qint8x16_t a, int fixed_point_position)
Calculate reciprocal of a fixed point 8bit number using the Newton-Raphson method.