NMSIS-NN  Version 1.2.0
NMSIS NN Software Library
Elementwise Functions

Elementwise add and multiplication functions. More...

Functions

riscv_nmsis_nn_status riscv_elementwise_add_s16 (const int16_t *input_1_vect, const int16_t *input_2_vect, const int32_t input_1_offset, const int32_t input_1_mult, const int32_t input_1_shift, const int32_t input_2_offset, const int32_t input_2_mult, const int32_t input_2_shift, const int32_t left_shift, int16_t *output, const int32_t out_offset, const int32_t out_mult, const int32_t out_shift, const int32_t out_activation_min, const int32_t out_activation_max, const int32_t block_size)
 s16 elementwise add of two vectors More...
 
riscv_nmsis_nn_status riscv_elementwise_add_s8 (const int8_t *input_1_vect, const int8_t *input_2_vect, const int32_t input_1_offset, const int32_t input_1_mult, const int32_t input_1_shift, const int32_t input_2_offset, const int32_t input_2_mult, const int32_t input_2_shift, const int32_t left_shift, int8_t *output, const int32_t out_offset, const int32_t out_mult, const int32_t out_shift, const int32_t out_activation_min, const int32_t out_activation_max, const int32_t block_size)
 s8 elementwise add of two vectors More...
 
riscv_nmsis_nn_status riscv_elementwise_mul_s16 (const int16_t *input_1_vect, const int16_t *input_2_vect, const int32_t input_1_offset, const int32_t input_2_offset, int16_t *output, const int32_t out_offset, const int32_t out_mult, const int32_t out_shift, const int32_t out_activation_min, const int32_t out_activation_max, const int32_t block_size)
 s16 element wise multiplication of two vectors More...
 
riscv_nmsis_nn_status riscv_elementwise_mul_s8 (const int8_t *input_1_vect, const int8_t *input_2_vect, const int32_t input_1_offset, const int32_t input_2_offset, int8_t *output, const int32_t out_offset, const int32_t out_mult, const int32_t out_shift, const int32_t out_activation_min, const int32_t out_activation_max, const int32_t block_size)
 s8 elementwise multiplication More...
 

Detailed Description

Elementwise add and multiplication functions.

Function Documentation

◆ riscv_elementwise_add_s16()

riscv_nmsis_nn_status riscv_elementwise_add_s16 ( const int16_t *  input_1_vect,
const int16_t *  input_2_vect,
const int32_t  input_1_offset,
const int32_t  input_1_mult,
const int32_t  input_1_shift,
const int32_t  input_2_offset,
const int32_t  input_2_mult,
const int32_t  input_2_shift,
const int32_t  left_shift,
int16_t *  output,
const int32_t  out_offset,
const int32_t  out_mult,
const int32_t  out_shift,
const int32_t  out_activation_min,
const int32_t  out_activation_max,
const int32_t  block_size 
)

s16 elementwise add of two vectors

Parameters
[in]input_1_vectpointer to input vector 1
[in]input_2_vectpointer to input vector 2
[in]input_1_offsetoffset for input 1. Not used.
[in]input_1_multmultiplier for input 1
[in]input_1_shiftshift for input 1
[in]input_2_offsetoffset for input 2. Not used.
[in]input_2_multmultiplier for input 2
[in]input_2_shiftshift for input 2
[in]left_shiftinput left shift
[in,out]outputpointer to output vector
[in]out_offsetoutput offset. Not used.
[in]out_multoutput multiplier
[in]out_shiftoutput shift
[in]out_activation_minminimum value to clamp output to. Min: -32768
[in]out_activation_maxmaximum value to clamp output to. Max: 32767
[in]block_sizenumber of samples
Returns
The function returns RISCV_NMSIS_NN_SUCCESS

◆ riscv_elementwise_add_s8()

riscv_nmsis_nn_status riscv_elementwise_add_s8 ( const int8_t *  input_1_vect,
const int8_t *  input_2_vect,
const int32_t  input_1_offset,
const int32_t  input_1_mult,
const int32_t  input_1_shift,
const int32_t  input_2_offset,
const int32_t  input_2_mult,
const int32_t  input_2_shift,
const int32_t  left_shift,
int8_t *  output,
const int32_t  out_offset,
const int32_t  out_mult,
const int32_t  out_shift,
const int32_t  out_activation_min,
const int32_t  out_activation_max,
const int32_t  block_size 
)

s8 elementwise add of two vectors

Parameters
[in]input_1_vectpointer to input vector 1
[in]input_2_vectpointer to input vector 2
[in]input_1_offsetoffset for input 1. Range: -127 to 128
[in]input_1_multmultiplier for input 1
[in]input_1_shiftshift for input 1
[in]input_2_offsetoffset for input 2. Range: -127 to 128
[in]input_2_multmultiplier for input 2
[in]input_2_shiftshift for input 2
[in]left_shiftinput left shift
[in,out]outputpointer to output vector
[in]out_offsetoutput offset. Range: -128 to 127
[in]out_multoutput multiplier
[in]out_shiftoutput shift
[in]out_activation_minminimum value to clamp output to. Min: -128
[in]out_activation_maxmaximum value to clamp output to. Max: 127
[in]block_sizenumber of samples
Returns
The function returns RISCV_NMSIS_NN_SUCCESS

◆ riscv_elementwise_mul_s16()

riscv_nmsis_nn_status riscv_elementwise_mul_s16 ( const int16_t *  input_1_vect,
const int16_t *  input_2_vect,
const int32_t  input_1_offset,
const int32_t  input_2_offset,
int16_t *  output,
const int32_t  out_offset,
const int32_t  out_mult,
const int32_t  out_shift,
const int32_t  out_activation_min,
const int32_t  out_activation_max,
const int32_t  block_size 
)

s16 element wise multiplication of two vectors

s16 elementwise multiplication

Note
Refer header file for details.

◆ riscv_elementwise_mul_s8()

riscv_nmsis_nn_status riscv_elementwise_mul_s8 ( const int8_t *  input_1_vect,
const int8_t *  input_2_vect,
const int32_t  input_1_offset,
const int32_t  input_2_offset,
int8_t *  output,
const int32_t  out_offset,
const int32_t  out_mult,
const int32_t  out_shift,
const int32_t  out_activation_min,
const int32_t  out_activation_max,
const int32_t  block_size 
)

s8 elementwise multiplication

Parameters
[in]input_1_vectpointer to input vector 1
[in]input_2_vectpointer to input vector 2
[in]input_1_offsetoffset for input 1. Range: -127 to 128
[in]input_2_offsetoffset for input 2. Range: -127 to 128
[in,out]outputpointer to output vector
[in]out_offsetoutput offset. Range: -128 to 127
[in]out_multoutput multiplier
[in]out_shiftoutput shift
[in]out_activation_minminimum value to clamp output to. Min: -128
[in]out_activation_maxmaximum value to clamp output to. Max: 127
[in]block_sizenumber of samples
Returns
The function returns RISCV_NMSIS_NN_SUCCESS

Supported framework: TensorFlow Lite micro