CMSIS-NN: Basic math functions

| CMSIS-NN Version 1.3.0 CMSIS NN Software Library

- Main Page
- Usage and Description
- Reference

All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Macros Groups Pages
Functions
Basic math functions
Neural Network Functions

## Functions

arm_status

arm_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 uint32_t block_size)

| s8 element wise add of two vectors More...
arm_status | arm_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 uint32_t block_size)
| s8 element wise multiplication of two vectors More...

## Description

Element wise add and multiplication functions.

## Function Documentation

arm_status arm_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 uint32_t | block_size
| ) |  |

Parameters

  [in] | input_1_vect | pointer to input vector 1
  [in] | input_2_vect | pointer to input vector 2
  [in] | input_1_offset | offset for input 1. Range: Range: -127 to 128
  [in] | input_1_mult | multiplier for input 1
  [in] | input_1_shift | shift for input 1
  [in] | input_2_offset | offset for input 2. Range: Range: -127 to 128
  [in] | input_2_mult | multiplier for input 2
  [in] | input_2_shift | shift for input 2
  [in] | left_shift | input left shift
  [in,out] | output | pointer to output vector
  [in] | out_offset | output offset
  [in] | out_mult | output multiplier
  [in] | out_shift | output shift
  [in] | out_activation_min | minimum value to clamp output to
  [in] | out_activation_max | maximum value to clamp output to
  [in] | block_size | number of samples

Returns
  The function returns ARM_MATH_SUCCESS

References arm_nn_divide_by_power_of_two(), arm_nn_sat_doubling_high_mult(), MAX, MIN, and SAT_INPUT.

arm_status arm_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 uint32_t | block_size
| ) |  |

s8 element wise multiplication

Note
  Refer header file for details.

References arm_nn_requantize(), MAX, and MIN.