CMSIS-NN  Version 1.2.0
CMSIS NN Software Library
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Macros Groups Pages
Basic Math Functions for Neural Network Computation

Functions

void arm_nn_accumulate_q7_to_q15 (q15_t *pDst, const q7_t *pSrc, uint32_t length)
 Converts the elements from a q7 vector and accumulate to a q15 vector. More...
 
void arm_nn_add_q7 (const q7_t *input, q31_t *output, uint32_t block_size)
 Non-saturating addition of elements of a q7 vector. More...
 
void arm_nn_mult_q15 (q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, const uint16_t out_shift, uint32_t blockSize)
 Q7 vector multiplication with variable output shifts. More...
 
void arm_nn_mult_q7 (q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, const uint16_t out_shift, uint32_t blockSize)
 Q7 vector multiplication with variable output shifts. More...
 

Description

Basic Math Functions for Neural Network Computation

Function Documentation

void arm_nn_accumulate_q7_to_q15 ( q15_t *  dst,
const q7_t *  src,
uint32_t  block_size 
)
Parameters
[in]*srcpoints to the q7 input vector
[out]*dstpoints to the q15 output vector
[in]block_sizelength of the input vector
Description:

The equation used for the conversion process is:

 dst[n] += (q15_t) src[n] ;   0 <= n < block_size.

References arm_nn_read_q15x2(), and arm_nn_read_q7x4_ia().

Referenced by arm_avgpool_s8().

void arm_nn_add_q7 ( const q7_t *  input,
q31_t *  output,
uint32_t  block_size 
)
Parameters
[in]*inputPointer to the q7 input vector
[out]*outputPointer to the q31 output variable.
[in]block_sizelength of the input vector
Description:

2^24 samples can be added without saturating the result.

The equation used for the conversion process is:

 sum = input[0] + input[1] + .. + input[block_size -1]

References arm_nn_read_q7x4_ia().

void arm_nn_mult_q15 ( q15_t *  pSrcA,
q15_t *  pSrcB,
q15_t *  pDst,
const uint16_t  out_shift,
uint32_t  blockSize 
)

q7 vector multiplication with variable output shifts

Parameters
[in]*pSrcApointer to the first input vector
[in]*pSrcBpointer to the second input vector
[out]*pDstpointer to the output vector
[in]out_shiftamount of right-shift for output
[in]blockSizenumber of samples in each vector

Scaling and Overflow Behavior:

The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] will be saturated.

References NN_ROUND.

void arm_nn_mult_q7 ( q7_t *  pSrcA,
q7_t *  pSrcB,
q7_t *  pDst,
const uint16_t  out_shift,
uint32_t  blockSize 
)

q7 vector multiplication with variable output shifts

Parameters
[in]*pSrcApointer to the first input vector
[in]*pSrcBpointer to the second input vector
[out]*pDstpointer to the output vector
[in]out_shiftamount of right-shift for output
[in]blockSizenumber of samples in each vector

Scaling and Overflow Behavior:

The function uses saturating arithmetic. Results outside of the allowable Q7 range [0x80 0x7F] will be saturated.

References NN_ROUND.