CMSIS-NN
Version 1.2.0
CMSIS NN Software Library
|
Data Structures | |
union | arm_nnword |
Union for SIMD access of q31/q15/q7 types. More... | |
Macros | |
#define | LEFT_SHIFT(_shift) |
#define | RIGHT_SHIFT(_shift) |
#define | MASK_IF_ZERO(x) |
#define | MASK_IF_NON_ZERO(x) |
#define | SELECT_USING_MASK(mask, a, b) |
#define | MAX(A, B) |
#define | MIN(A, B) |
#define | CLAMP(x, h, l) |
#define | NN_ROUND(out_shift) |
macro for adding rounding offset More... | |
#define | MUL_SAT(a, b) |
#define | MUL_POW2(a, b) |
#define | DIV_POW2(a, b) |
#define | EXP_ON_NEG(x) |
#define | ONE_OVER1(x) |
#define | SELECT_IF_NON_ZERO(x) |
Enumerations | |
enum | arm_nn_activation_type |
Struct for specifying activation function types. More... | |
Functions | |
void | arm_q7_to_q15_no_shift (const q7_t *pSrc, q15_t *pDst, uint32_t blockSize) |
Converts the elements of the q7 vector to q15 vector without left-shift. 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_q7_to_q15_reordered_no_shift (const q7_t *pSrc, q15_t *pDst, uint32_t blockSize) |
Converts the elements of the q7 vector to reordered q15 vector without left-shift. More... | |
void | arm_q7_to_q15_with_offset (const q7_t *src, q15_t *dst, uint32_t block_size, q7_t offset) |
Converts the elements from a q7 vector to a q15 vector with an added offset. More... | |
void | arm_q7_to_q15_reordered_with_offset (const q7_t *src, q15_t *dst, uint32_t block_size, q7_t offset) |
Converts the elements of the q7 vector to reordered q15 vector with an added offset. More... | |
void | arm_nn_accumulate_q7_to_q15 (q15_t *dst, const q7_t *src, uint32_t block_size) |
Converts the elements from a q7 vector and accumulate to a q15 vector. More... | |
__STATIC_FORCEINLINE q31_t | arm_nn_read_q15x2_ia (const q15_t **in_q15) |
Read 2 q15 elements and post increment pointer. More... | |
__STATIC_FORCEINLINE q31_t | arm_nn_read_q7x4_ia (const q7_t **in_q7) |
Read 4 q7 from q7 pointer and post increment pointer. More... | |
__STATIC_FORCEINLINE q31_t | arm_nn_read_q15x2 (const q15_t *in_q15) |
Read 2 q15 from q15 pointer. More... | |
__STATIC_FORCEINLINE q31_t | arm_nn_read_q7x4 (const q7_t *in_q7) |
Read 4 q7 values. 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... | |
__STATIC_FORCEINLINE q31_t | arm_nn_sat_doubling_high_mult (const q31_t m1, const q31_t m2) |
Saturating doubling high multiply. Result matches NEON instruction VQRDMULH. More... | |
__STATIC_FORCEINLINE q31_t | arm_nn_divide_by_power_of_two (const q31_t dividend, const q31_t exponent) |
Rounding divide by power of two. More... | |
__STATIC_FORCEINLINE q31_t | arm_nn_requantize (const q31_t val, const q31_t multiplier, const q31_t shift) |
Requantize a given value. More... | |
__STATIC_FORCEINLINE int32_t | arm_nn_exp_on_negative_values (int32_t val) |
__STATIC_FORCEINLINE q31_t | arm_nn_mult_by_power_of_two (const int32_t val, const int32_t exp) |
__STATIC_FORCEINLINE int32_t | arm_nn_one_over_one_plus_x_for_x_in_0_1 (int32_t val) |
#define CLAMP | ( | x, | |
h, | |||
l | |||
) |
Referenced by arm_softmax_s8().
#define DIV_POW2 | ( | a, | |
b | |||
) |
Referenced by arm_nn_exp_on_negative_values(), and arm_softmax_s8().
#define EXP_ON_NEG | ( | x | ) |
Referenced by arm_softmax_s8().
#define LEFT_SHIFT | ( | _shift | ) |
Referenced by arm_depthwise_conv_u8_basic_ver1(), arm_fully_connected_s8(), and arm_nn_requantize().
#define MASK_IF_NON_ZERO | ( | x | ) |
Referenced by arm_nn_mult_by_power_of_two().
#define MASK_IF_ZERO | ( | x | ) |
Referenced by arm_nn_exp_on_negative_values().
#define MAX | ( | A, | |
B | |||
) |
Referenced by arm_avgpool_s8(), arm_convolve_1x1_s8_fast(), arm_convolve_s8(), arm_depthwise_conv_s8(), arm_depthwise_conv_s8_opt(), arm_elementwise_add_s8(), arm_elementwise_mul_s8(), arm_fully_connected_s8(), arm_max_pool_s8(), arm_nn_mat_mult_kernel_s8_s16(), arm_nn_mat_mult_kernel_s8_s16_reordered(), arm_relu6_s8(), and arm_softmax_s8().
#define MIN | ( | A, | |
B | |||
) |
Referenced by arm_avgpool_s8(), arm_convolve_1x1_s8_fast(), arm_convolve_s8(), arm_depthwise_conv_s8(), arm_depthwise_conv_s8_opt(), arm_elementwise_add_s8(), arm_elementwise_mul_s8(), arm_fully_connected_s8(), arm_max_pool_s8(), arm_nn_mat_mult_kernel_s8_s16(), arm_nn_mat_mult_kernel_s8_s16_reordered(), and arm_relu6_s8().
#define MUL_POW2 | ( | a, | |
b | |||
) |
Referenced by arm_nn_one_over_one_plus_x_for_x_in_0_1().
#define MUL_SAT | ( | a, | |
b | |||
) |
Referenced by arm_nn_exp_on_negative_values(), arm_nn_one_over_one_plus_x_for_x_in_0_1(), and arm_softmax_s8().
#define NN_ROUND | ( | out_shift | ) |
Referenced by arm_convolve_1x1_HWC_q7_fast_nonsquare(), arm_convolve_HWC_q15_basic(), arm_convolve_HWC_q15_fast(), arm_convolve_HWC_q15_fast_nonsquare(), arm_convolve_HWC_q7_basic(), arm_convolve_HWC_q7_basic_nonsquare(), arm_convolve_HWC_q7_fast(), arm_convolve_HWC_q7_fast_nonsquare(), arm_convolve_HWC_q7_RGB(), arm_depthwise_separable_conv_HWC_q7(), arm_depthwise_separable_conv_HWC_q7_nonsquare(), arm_fully_connected_mat_q7_vec_q15(), arm_fully_connected_mat_q7_vec_q15_opt(), arm_fully_connected_q15(), arm_fully_connected_q15_opt(), arm_fully_connected_q7(), arm_fully_connected_q7_opt(), arm_nn_mat_mult_kernel_q7_q15(), arm_nn_mat_mult_kernel_q7_q15_reordered(), arm_nn_mult_q15(), and arm_nn_mult_q7().
#define ONE_OVER1 | ( | x | ) |
Referenced by arm_softmax_s8().
#define RIGHT_SHIFT | ( | _shift | ) |
Referenced by arm_depthwise_conv_u8_basic_ver1(), arm_fully_connected_s8(), and arm_nn_requantize().
#define SELECT_IF_NON_ZERO | ( | x | ) |
Referenced by arm_nn_exp_on_negative_values().
#define SELECT_USING_MASK | ( | mask, | |
a, | |||
b | |||
) |
Referenced by arm_nn_exp_on_negative_values(), and arm_nn_mult_by_power_of_two().
__STATIC_FORCEINLINE q31_t arm_nn_divide_by_power_of_two | ( | const q31_t | dividend, |
const q31_t | exponent | ||
) |
[in] | dividend | - Dividend |
[in] | exponent | - Divisor = power(2, exponent) Range: [0, 31] |
Referenced by arm_depthwise_conv_u8_basic_ver1(), arm_elementwise_add_s8(), arm_elementwise_mul_s8(), arm_fully_connected_s8(), and arm_nn_requantize().
__STATIC_FORCEINLINE int32_t arm_nn_exp_on_negative_values | ( | int32_t | val | ) |
References DIV_POW2, MASK_IF_ZERO, MUL_SAT, SELECT_IF_NON_ZERO, and SELECT_USING_MASK.
__STATIC_FORCEINLINE q31_t arm_nn_mult_by_power_of_two | ( | const int32_t | val, |
const int32_t | exp | ||
) |
References MASK_IF_NON_ZERO, and SELECT_USING_MASK.
__STATIC_FORCEINLINE int32_t arm_nn_one_over_one_plus_x_for_x_in_0_1 | ( | int32_t | val | ) |
__STATIC_FORCEINLINE q31_t arm_nn_read_q15x2 | ( | const q15_t * | in_q15 | ) |
[in] | in_q15 | pointer to address of input. |
Referenced by arm_depthwise_conv_s8_opt(), and arm_nn_accumulate_q7_to_q15().
__STATIC_FORCEINLINE q31_t arm_nn_read_q15x2_ia | ( | const q15_t ** | in_q15 | ) |
[in] | in_q15 | Pointer to pointer that holds address of input. |
Referenced by arm_convolve_1x1_s8_fast(), arm_convolve_s8(), arm_nn_mat_mult_kernel_s8_s16(), and arm_nn_mat_mult_kernel_s8_s16_reordered().
__STATIC_FORCEINLINE q31_t arm_nn_read_q7x4 | ( | const q7_t * | in_q7 | ) |
[in] | in_q7 | pointer to address of input. |
Referenced by arm_depthwise_conv_s8_opt().
__STATIC_FORCEINLINE q31_t arm_nn_read_q7x4_ia | ( | const q7_t ** | in_q7 | ) |
[in] | in_q7 | Pointer to pointer that holds address of input. |
Referenced by arm_nn_accumulate_q7_to_q15(), arm_nn_add_q7(), arm_q7_to_q15_no_shift(), arm_q7_to_q15_reordered_no_shift(), arm_q7_to_q15_reordered_with_offset(), arm_q7_to_q15_with_offset(), and arm_softmax_q7().
__STATIC_FORCEINLINE q31_t arm_nn_requantize | ( | const q31_t | val, |
const q31_t | multiplier, | ||
const q31_t | shift | ||
) |
[in] | val | Value to be requantized |
[in] | multiplier | multiplier |
[in] | shift | left or right shift for 'val * multiplier' |
References arm_nn_divide_by_power_of_two(), arm_nn_sat_doubling_high_mult(), LEFT_SHIFT, and RIGHT_SHIFT.
Referenced by arm_convolve_1x1_s8_fast(), arm_convolve_s8(), arm_depthwise_conv_s8(), arm_depthwise_conv_s8_opt(), arm_nn_mat_mult_kernel_s8_s16(), and arm_nn_mat_mult_kernel_s8_s16_reordered().
__STATIC_FORCEINLINE q31_t arm_nn_sat_doubling_high_mult | ( | const q31_t | m1, |
const q31_t | m2 | ||
) |
[in] | m1 | Multiplicand |
[in] | m2 | Multiplier |
Referenced by arm_depthwise_conv_u8_basic_ver1(), arm_elementwise_add_s8(), arm_elementwise_mul_s8(), arm_fully_connected_s8(), and arm_nn_requantize().