ONE - On-device Neural Engine
|
#include "helpers.h"
Go to the source code of this file.
Macros | |
#define | REPEAT_3_1(P_X, P_A, P_B, P_C) P_X##_DEF(0, P_A, P_B, P_C) |
#define | REPEAT_3_2(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_3(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_4(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_5(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_6(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_7(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_8(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_9(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_10(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_11(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_12(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_13(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_14(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_15(P_X, P_A, P_B, P_C) |
#define | REPEAT_3_16(P_X, P_A, P_B, P_C) |
#define | REPEAT_DEF_3_N(P_NUM, P_OP, P_A, P_B, P_C) REPEAT_3_##P_NUM(P_OP, P_A, P_B, P_C) |
#define | REPEAT_3_N(P_NUM, P_OP, P_A, P_B, P_C) REPEAT_DEF_3_N(P_NUM, P_OP, P_A, P_B, P_C) |
#define | REPEAT_4_1(P_X, P_A, P_B, P_C, P_D) P_X##_DEF(0, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_2(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_3(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_4(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_5(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_6(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_7(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_8(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_9(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_10(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_11(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_12(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_13(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_14(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_15(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_16(P_X, P_A, P_B, P_C, P_D) |
#define | REPEAT_DEF_4_N(P_NUM, P_OP, P_A, P_B, P_C, P_D) REPEAT_4_##P_NUM(P_OP, P_A, P_B, P_C, P_D) |
#define | REPEAT_4_N(P_NUM, P_OP, P_A, P_B, P_C, P_D) REPEAT_DEF_4_N(P_NUM, P_OP, P_A, P_B, P_C, P_D) |
#define | VAR_INIT_TO_CONST_DEF(ID, TYPE, VAR, VAL) TYPE VAR##ID = VAL |
#define | REPEAT_VAR_INIT_TO_CONST(N, TYPE, VAR, VAL) REPEAT_3_N(N, VAR_INIT_TO_CONST, TYPE, VAR, VAL) |
#define | VAR_INIT_CONVERT_SAT_DEF(ID, TYPE_OUT, VAR_IN, VAR_OUT) TYPE_OUT VAR_OUT##ID = CONVERT_SAT(VAR_IN##ID, TYPE_OUT) |
#define | REPEAT_VAR_INIT_CONVERT_SAT(N, TYPE_OUT, VAR_IN, VAR_OUT) REPEAT_3_N(N, VAR_INIT_CONVERT_SAT, TYPE_OUT, VAR_IN, VAR_OUT) |
#define | ADD_CONST_TO_VAR_DEF(ID, TYPE, VAR, VAL) VAR##ID += (TYPE)VAL |
#define | REPEAT_ADD_CONST_TO_VAR(N, TYPE, VAR, VAL) REPEAT_3_N(N, ADD_CONST_TO_VAR, TYPE, VAR, VAL) |
#define | MLA_VAR_WITH_CONST_VEC_DEF(ID, VAR_A, VAR_B, VAL) VAR_A##ID += VAR_B##ID * VAL |
#define | REPEAT_MLA_VAR_WITH_CONST_VEC(N, VAR_A, VAR_B, VAL) REPEAT_3_N(N, MLA_VAR_WITH_CONST_VEC, VAR_A, VAR_B, VAL) |
#define | ADD_VECTOR_TO_VAR_DEF(ID, TYPE, VAR, VEC) VAR##ID += VEC |
#define | REPEAT_ADD_VECTOR_TO_VAR(N, VAR, VEC) REPEAT_3_N(N, ADD_VECTOR_TO_VAR, "", VAR, VEC) |
#define | ADD_TWO_VARS_DEF(ID, TYPE, VAR_A, VAR_B) VAR_A##ID += VAR_B##ID |
#define | REPEAT_ADD_TWO_VARS(N, VAR_A, VAR_B) REPEAT_3_N(N, ADD_TWO_VARS, "", VAR_A, VAR_B) |
#define | MAX_CONST_VAR_DEF(ID, TYPE, VAR, VAL) VAR##ID = max(VAR##ID, (TYPE)VAL) |
#define | REPEAT_MAX_CONST_VAR(N, TYPE, VAR, VAL) REPEAT_3_N(N, MAX_CONST_VAR, TYPE, VAR, VAL) |
#define | MIN_CONST_VAR_DEF(ID, TYPE, VAR, VAL) VAR##ID = min(VAR##ID, (TYPE)VAL) |
#define | REPEAT_MIN_CONST_VAR(N, TYPE, VAR, VAL) REPEAT_3_N(N, MIN_CONST_VAR, TYPE, VAR, VAL) |
#define | ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE_DEF(ID, SIZE, VAR, RES_MUL, RES_SHIFT) VAR##ID = ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE(VAR##ID, RES_MUL, RES_SHIFT, SIZE) |
#define | REPEAT_ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE(N, SIZE, VAR, RES_MUL, RES_SHIFT) REPEAT_4_N(N, ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define | ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE_DEF(ID, SIZE, VAR, RES_MUL, RES_SHIFT) VAR##ID = ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE(VAR##ID, RES_MUL, RES_SHIFT, SIZE) |
#define | REPEAT_ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE(N, SIZE, VAR, RES_MUL, RES_SHIFT) REPEAT_4_N(N, ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define | ASYMM_MULT_BY_QUANT_MULTIPLIER_PER_CHANNEL_DEF(ID, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define | REPEAT_ASYMM_MULT_BY_QUANT_MULTIPLIER_PER_CHANNEL(N, SIZE, VAR, RES_MUL, RES_SHIFT) REPEAT_4_N(N, ASYMM_MULT_BY_QUANT_MULTIPLIER_PER_CHANNEL, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define ADD_CONST_TO_VAR_DEF | ( | ID, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | VAR##ID += (TYPE)VAL |
#define ADD_TWO_VARS_DEF | ( | ID, | |
TYPE, | |||
VAR_A, | |||
VAR_B | |||
) | VAR_A##ID += VAR_B##ID |
#define ADD_VECTOR_TO_VAR_DEF | ( | ID, | |
TYPE, | |||
VAR, | |||
VEC | |||
) | VAR##ID += VEC |
#define ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE_DEF | ( | ID, | |
SIZE, | |||
VAR, | |||
RES_MUL, | |||
RES_SHIFT | |||
) | VAR##ID = ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE(VAR##ID, RES_MUL, RES_SHIFT, SIZE) |
Definition at line 197 of file repeat.h.
#define ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE_DEF | ( | ID, | |
SIZE, | |||
VAR, | |||
RES_MUL, | |||
RES_SHIFT | |||
) | VAR##ID = ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE(VAR##ID, RES_MUL, RES_SHIFT, SIZE) |
#define ASYMM_MULT_BY_QUANT_MULTIPLIER_PER_CHANNEL_DEF | ( | ID, | |
SIZE, | |||
VAR, | |||
RES_MUL, | |||
RES_SHIFT | |||
) |
Definition at line 210 of file repeat.h.
#define MAX_CONST_VAR_DEF | ( | ID, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | VAR##ID = max(VAR##ID, (TYPE)VAL) |
#define MIN_CONST_VAR_DEF | ( | ID, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | VAR##ID = min(VAR##ID, (TYPE)VAL) |
#define MLA_VAR_WITH_CONST_VEC_DEF | ( | ID, | |
VAR_A, | |||
VAR_B, | |||
VAL | |||
) | VAR_A##ID += VAR_B##ID * VAL |
#define REPEAT_3_1 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) | P_X##_DEF(0, P_A, P_B, P_C) |
#define REPEAT_3_10 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_11 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_12 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_13 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_14 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_15 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_16 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_2 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_3 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_4 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_5 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_6 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_7 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_8 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_9 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C | |||
) |
#define REPEAT_3_N | ( | P_NUM, | |
P_OP, | |||
P_A, | |||
P_B, | |||
P_C | |||
) | REPEAT_DEF_3_N(P_NUM, P_OP, P_A, P_B, P_C) |
#define REPEAT_4_1 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) | P_X##_DEF(0, P_A, P_B, P_C, P_D) |
#define REPEAT_4_10 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_11 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_12 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_13 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_14 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_15 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_16 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_2 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_3 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_4 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_5 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_6 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_7 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_8 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_9 | ( | P_X, | |
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) |
#define REPEAT_4_N | ( | P_NUM, | |
P_OP, | |||
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) | REPEAT_DEF_4_N(P_NUM, P_OP, P_A, P_B, P_C, P_D) |
#define REPEAT_ADD_CONST_TO_VAR | ( | N, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | REPEAT_3_N(N, ADD_CONST_TO_VAR, TYPE, VAR, VAL) |
#define REPEAT_ADD_TWO_VARS | ( | N, | |
VAR_A, | |||
VAR_B | |||
) | REPEAT_3_N(N, ADD_TWO_VARS, "", VAR_A, VAR_B) |
#define REPEAT_ADD_VECTOR_TO_VAR | ( | N, | |
VAR, | |||
VEC | |||
) | REPEAT_3_N(N, ADD_VECTOR_TO_VAR, "", VAR, VEC) |
#define REPEAT_ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE | ( | N, | |
SIZE, | |||
VAR, | |||
RES_MUL, | |||
RES_SHIFT | |||
) | REPEAT_4_N(N, ASYMM_MULT_BY_QUANT_MULTIPLIER_GREATER_THAN_ONE, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define REPEAT_ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE | ( | N, | |
SIZE, | |||
VAR, | |||
RES_MUL, | |||
RES_SHIFT | |||
) | REPEAT_4_N(N, ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define REPEAT_ASYMM_MULT_BY_QUANT_MULTIPLIER_PER_CHANNEL | ( | N, | |
SIZE, | |||
VAR, | |||
RES_MUL, | |||
RES_SHIFT | |||
) | REPEAT_4_N(N, ASYMM_MULT_BY_QUANT_MULTIPLIER_PER_CHANNEL, SIZE, VAR, RES_MUL, RES_SHIFT) |
#define REPEAT_DEF_3_N | ( | P_NUM, | |
P_OP, | |||
P_A, | |||
P_B, | |||
P_C | |||
) | REPEAT_3_##P_NUM(P_OP, P_A, P_B, P_C) |
#define REPEAT_DEF_4_N | ( | P_NUM, | |
P_OP, | |||
P_A, | |||
P_B, | |||
P_C, | |||
P_D | |||
) | REPEAT_4_##P_NUM(P_OP, P_A, P_B, P_C, P_D) |
#define REPEAT_MAX_CONST_VAR | ( | N, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | REPEAT_3_N(N, MAX_CONST_VAR, TYPE, VAR, VAL) |
#define REPEAT_MIN_CONST_VAR | ( | N, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | REPEAT_3_N(N, MIN_CONST_VAR, TYPE, VAR, VAL) |
#define REPEAT_MLA_VAR_WITH_CONST_VEC | ( | N, | |
VAR_A, | |||
VAR_B, | |||
VAL | |||
) | REPEAT_3_N(N, MLA_VAR_WITH_CONST_VEC, VAR_A, VAR_B, VAL) |
#define REPEAT_VAR_INIT_CONVERT_SAT | ( | N, | |
TYPE_OUT, | |||
VAR_IN, | |||
VAR_OUT | |||
) | REPEAT_3_N(N, VAR_INIT_CONVERT_SAT, TYPE_OUT, VAR_IN, VAR_OUT) |
#define REPEAT_VAR_INIT_TO_CONST | ( | N, | |
TYPE, | |||
VAR, | |||
VAL | |||
) | REPEAT_3_N(N, VAR_INIT_TO_CONST, TYPE, VAR, VAL) |
#define VAR_INIT_CONVERT_SAT_DEF | ( | ID, | |
TYPE_OUT, | |||
VAR_IN, | |||
VAR_OUT | |||
) | TYPE_OUT VAR_OUT##ID = CONVERT_SAT(VAR_IN##ID, TYPE_OUT) |