![]() |
MMALIB User Guide
|
This module consists of definitions (macros, structures, utility functions) that are commonly applicable to all MMALIB kernels.
File to hold buffer parameter related info for MMALIB.
Data Structures | |
| struct | MMALIB_bufParams1D_t |
| A structure for a 1 dimensional buffer descriptor. More... | |
| struct | MMALIB_bufParams2D_t |
| A structure for a 2 dimensional buffer descriptor. More... | |
| struct | MMALIB_bufParams3D_t |
| A structure for a 3 dimensional buffer descriptor. More... | |
| struct | MMALIB_bufParamsND_t |
| A structure for a N dimensional buffer descriptor. More... | |
Functions | |
| static int32_t | MMALIB_sizeof (uint32_t type) |
Variables | |
| static const int32_t | size_of_type [] |
| Inline function returns number of bytes per element given a type of MMALIB_data_type_e. More... | |
Macros | |
| #define | MMALIB_CALC_STRIDE(BYTES, ALIGN_SHIFT) (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT)) |
| Macro function that computes the minimum stride for the specified number of bytes and alignment. More... | |
| #define | MMALIB_MMA_SIZE_8_BIT_SHIFT 6 |
| Macro for MMALIB shift amounts. More... | |
| #define | MMALIB_MMA_SIZE_16_BIT_SHIFT 5 |
| Shift for MMA size when data type is 16-bit integers. More... | |
| #define | MMALIB_MMA_SIZE_32_BIT_SHIFT 4 |
| Shift for MMA size when data type is 32-bit integers. More... | |
| #define | MMALIB_CALC_STRIDE(BYTES, ALIGN_SHIFT) (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT)) |
| Macro function that computes the minimum stride for the specified number of bytes and alignment. More... | |
| #define | MMALIB_MMA_SIZE_8_BIT_SHIFT 5 |
| Macro for MMALIB shift amounts. More... | |
| #define | MMALIB_MMA_SIZE_16_BIT_SHIFT 4 |
| Shift for MMA size when data type is 16-bit integers. More... | |
| #define | MMALIB_MMA_SIZE_32_BIT_SHIFT 3 |
| Shift for MMA size when data type is 32-bit integers. More... | |
| #define | MMALIB_CALC_STRIDE(BYTES, ALIGN_SHIFT) (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT)) |
| Macro function that computes the minimum stride for the specified number of bytes and alignment. More... | |
| #define | MMALIB_MMA_SIZE_8_BIT_SHIFT 7 |
| Macro for MMALIB shift amounts. More... | |
| #define | MMALIB_MMA_SIZE_16_BIT_SHIFT 6 |
| Shift for MMA size when data type is 16-bit integers. More... | |
| #define | MMALIB_MMA_SIZE_32_BIT_SHIFT 5 |
| Shift for MMA size when data type is 32-bit integers. More... | |
| #define | MMALIB_ISSIGNED(type) ((type) < MMALIB_UINT8 || (type) > MMALIB_UINT128) |
| #define | MMALIB_SIGNEDNESS(type) (MMALIB_ISSIGNED((type)) ? "signed" : "unsigned") |
| #define | MMALIB_PARAM_SIZE 192 |
| Parameter structure size in bytes, was 128. Because TDA5 devices offset regs are 128 bytes wide. More... | |
| #define | MMALIB_BYTE_WIDTH __MMA_A_COLS(sizeof(int8_t)) |
| MMA width in bytes. More... | |
| #define | MMALIB_MMA_ACCUMULATOR_BYTE_WIDTH_8_BIT 4 |
| MMA accumulator width in bytes for 8 bit output data width. More... | |
| #define | MMALIB_MMA_ACCUMULATOR_BYTE_WIDTH_16_BIT 8 |
| MMA accumulator width in bytes for 16 bit output data width. More... | |
| #define | MMALIB_MMA_ACCUMULATOR_BYTE_WIDTH_32_BIT 16 |
| MMA accumulator width in bytes for 32 bit output data width. More... | |
| #define | MMALIB_ALIGN_SHIFT_64BYTES 6 |
| Number of bits to shift for 64-byte memory alignment. More... | |
| #define | MMALIB_ALIGN_SHIFT_128BYTES 7 |
| Number of bits to shift for 128-byte memory alignment. More... | |
| #define | MMALIB_ALIGN_SHIFT_256BYTES 8 |
| Number of bits to shift for 256-byte memory alignment. More... | |
| #define | MMALIB_ALIGN_64BYTES (1 << MMALIB_ALIGN_SHIFT_64BYTES) |
| Align by 64-byte memory alignment. More... | |
| #define | MMALIB_ALIGN_128BYTES (1 << MMALIB_ALIGN_SHIFT_128BYTES) |
| Align by 128-byte memory alignment. More... | |
| #define | MMALIB_ALIGN_256BYTES (1 << MMALIB_ALIGN_SHIFT_256BYTES) |
| Align by 256-byte memory alignment. More... | |
| #define | MMALIB_L2DATA_ALIGN_SHIFT MMALIB_ALIGN_SHIFT_64BYTES |
| Set the default L2 data alignment. More... | |
| #define | MMALIB_L2DATA_ALIGNMENT (((uint32_t)1) << ((uint32_t)MMALIB_L2DATA_ALIGN_SHIFT)) |
| Macro that specifies the alignment of data buffers in L2 memory for optimal performance. More... | |
| #define | MMALIB_MMA_SIZE_8_BIT __MMA_A_COLS(sizeof(int8_t)) |
| MMA size as a function of precision. More... | |
| #define | MMALIB_MMA_SIZE_16_BIT __MMA_A_COLS(sizeof(int16_t)) |
| #define | MMALIB_MMA_SIZE_32_BIT __MMA_A_COLS(sizeof(int32_t)) |
| #define | MMALIB_MMA_BIAS_SIZE_32_BIT __MMA_A_COLS(sizeof(int32_t)) |
| #define | MMALIB_MMA_BIAS_SIZE_64_BIT ((MMALIB_MMA_BIAS_SIZE_32_BIT) >> 1) |
| #define MMALIB_CALC_STRIDE | ( | BYTES, | |
| ALIGN_SHIFT | |||
| ) | (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT)) |
Macro function that computes the minimum stride for the specified number of bytes and alignment.
Definition at line 85 of file c7100/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_8_BIT_SHIFT 6 |
Macro for MMALIB shift amounts.
Shift for MMA size when data type is 8-bit integers
Definition at line 89 of file c7100/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_16_BIT_SHIFT 5 |
Shift for MMA size when data type is 16-bit integers.
Definition at line 90 of file c7100/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_32_BIT_SHIFT 4 |
Shift for MMA size when data type is 32-bit integers.
Definition at line 91 of file c7100/MMALIB_types.h.
| #define MMALIB_CALC_STRIDE | ( | BYTES, | |
| ALIGN_SHIFT | |||
| ) | (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT)) |
Macro function that computes the minimum stride for the specified number of bytes and alignment.
Definition at line 167 of file c7524f/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_8_BIT_SHIFT 5 |
Macro for MMALIB shift amounts.
Shift for MMA size when data type is 8-bit integers
Definition at line 171 of file c7524f/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_16_BIT_SHIFT 4 |
Shift for MMA size when data type is 16-bit integers.
Definition at line 172 of file c7524f/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_32_BIT_SHIFT 3 |
Shift for MMA size when data type is 32-bit integers.
Definition at line 173 of file c7524f/MMALIB_types.h.
| #define MMALIB_CALC_STRIDE | ( | BYTES, | |
| ALIGN_SHIFT | |||
| ) | (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT)) |
Macro function that computes the minimum stride for the specified number of bytes and alignment.
Definition at line 193 of file c7604/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_8_BIT_SHIFT 7 |
Macro for MMALIB shift amounts.
Shift for MMA size when data type is 8-bit integers
Definition at line 197 of file c7604/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_16_BIT_SHIFT 6 |
Shift for MMA size when data type is 16-bit integers.
Definition at line 198 of file c7604/MMALIB_types.h.
| #define MMALIB_MMA_SIZE_32_BIT_SHIFT 5 |
Shift for MMA size when data type is 32-bit integers.
Definition at line 199 of file c7604/MMALIB_types.h.
| #define MMALIB_ISSIGNED | ( | type | ) | ((type) < MMALIB_UINT8 || (type) > MMALIB_UINT128) |
Definition at line 69 of file MMALIB_bufParams.h.
| #define MMALIB_SIGNEDNESS | ( | type | ) | (MMALIB_ISSIGNED((type)) ? "signed" : "unsigned") |
Definition at line 70 of file MMALIB_bufParams.h.
| #define MMALIB_PARAM_SIZE 192 |
Parameter structure size in bytes, was 128. Because TDA5 devices offset regs are 128 bytes wide.
Definition at line 337 of file MMALIB_types.h.
| #define MMALIB_BYTE_WIDTH __MMA_A_COLS(sizeof(int8_t)) |
MMA width in bytes.
Definition at line 338 of file MMALIB_types.h.
| #define MMALIB_MMA_ACCUMULATOR_BYTE_WIDTH_8_BIT 4 |
MMA accumulator width in bytes for 8 bit output data width.
Definition at line 339 of file MMALIB_types.h.
| #define MMALIB_MMA_ACCUMULATOR_BYTE_WIDTH_16_BIT 8 |
MMA accumulator width in bytes for 16 bit output data width.
Definition at line 340 of file MMALIB_types.h.
| #define MMALIB_MMA_ACCUMULATOR_BYTE_WIDTH_32_BIT 16 |
MMA accumulator width in bytes for 32 bit output data width.
Definition at line 341 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_64BYTES 6 |
Number of bits to shift for 64-byte memory alignment.
Definition at line 351 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_128BYTES 7 |
Number of bits to shift for 128-byte memory alignment.
Definition at line 353 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_256BYTES 8 |
Number of bits to shift for 256-byte memory alignment.
Definition at line 355 of file MMALIB_types.h.
| #define MMALIB_ALIGN_64BYTES (1 << MMALIB_ALIGN_SHIFT_64BYTES) |
Align by 64-byte memory alignment.
Definition at line 358 of file MMALIB_types.h.
| #define MMALIB_ALIGN_128BYTES (1 << MMALIB_ALIGN_SHIFT_128BYTES) |
Align by 128-byte memory alignment.
Definition at line 360 of file MMALIB_types.h.
| #define MMALIB_ALIGN_256BYTES (1 << MMALIB_ALIGN_SHIFT_256BYTES) |
Align by 256-byte memory alignment.
Definition at line 362 of file MMALIB_types.h.
| #define MMALIB_L2DATA_ALIGN_SHIFT MMALIB_ALIGN_SHIFT_64BYTES |
Set the default L2 data alignment.
Definition at line 365 of file MMALIB_types.h.
| #define MMALIB_L2DATA_ALIGNMENT (((uint32_t)1) << ((uint32_t)MMALIB_L2DATA_ALIGN_SHIFT)) |
Macro that specifies the alignment of data buffers in L2 memory for optimal performance.
Definition at line 369 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_8_BIT __MMA_A_COLS(sizeof(int8_t)) |
MMA size as a function of precision.
Definition at line 378 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_16_BIT __MMA_A_COLS(sizeof(int16_t)) |
Definition at line 379 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_32_BIT __MMA_A_COLS(sizeof(int32_t)) |
Definition at line 380 of file MMALIB_types.h.
| #define MMALIB_MMA_BIAS_SIZE_32_BIT __MMA_A_COLS(sizeof(int32_t)) |
Definition at line 383 of file MMALIB_types.h.
| #define MMALIB_MMA_BIAS_SIZE_64_BIT ((MMALIB_MMA_BIAS_SIZE_32_BIT) >> 1) |
Definition at line 384 of file MMALIB_types.h.
Definition at line 60 of file c7100/MMALIB_types.h.
Definition at line 66 of file c7100/MMALIB_types.h.
Definition at line 126 of file c7524f/MMALIB_types.h.
Type for enableDynamicRange variables.
Definition at line 140 of file c7524f/MMALIB_types.h.
Type for initDynamicRange variables.
Definition at line 141 of file c7524f/MMALIB_types.h.
Type for initDynamicRange variables.
Definition at line 148 of file c7524f/MMALIB_types.h.
Definition at line 153 of file c7604/MMALIB_types.h.
Type for enableDynamicRange variables.
Definition at line 167 of file c7604/MMALIB_types.h.
Type for initDynamicRange variables.
Definition at line 168 of file c7604/MMALIB_types.h.
Type for initDynamicRange variables.
Definition at line 175 of file c7604/MMALIB_types.h.
| typedef double MMALIB_D64 |
Double precision floating point.
Definition at line 169 of file MMALIB_types.h.
| typedef float MMALIB_F32 |
Single precision floating point.
Definition at line 170 of file MMALIB_types.h.
| typedef MMALIB_STATUS_NAME MMALIB_STATUS |
Return value for MMALIB functions.
Definition at line 282 of file MMALIB_types.h.
| typedef void* MMALIB_kernelHandle |
Handle type for MMALIB operations.
Definition at line 284 of file MMALIB_types.h.
Definition at line 309 of file MMALIB_types.h.
| typedef MMALIB_LUT_type_e MMALIB_LUT_type |
Definition at line 316 of file MMALIB_types.h.
| typedef MMALIB_broadcast_e MMALIB_broadcast |
Definition at line 329 of file MMALIB_types.h.
The enumeration of possible activation operations on the computation.
Definition at line 54 of file c7100/MMALIB_types.h.
| Enumerator | |
|---|---|
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
Definition at line 62 of file c7100/MMALIB_types.h.
The enumeration of possible activation operations on the computation.
Definition at line 119 of file c7524f/MMALIB_types.h.
The enumeration of possible dynamic range enable settings.
Definition at line 129 of file c7524f/MMALIB_types.h.
The enumeration of possible dynamic range reset options.
Definition at line 135 of file c7524f/MMALIB_types.h.
The enumeration of possible quantization methods.
| Enumerator | |
|---|---|
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
Definition at line 144 of file c7524f/MMALIB_types.h.
The enumeration of possible activation operations on the computation.
Definition at line 146 of file c7604/MMALIB_types.h.
The enumeration of possible dynamic range enable settings.
Definition at line 156 of file c7604/MMALIB_types.h.
The enumeration of possible dynamic range reset options.
Definition at line 162 of file c7604/MMALIB_types.h.
The enumeration of possible quantization methods.
| Enumerator | |
|---|---|
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
| MMALIB_QUANT_PER_KERNEL | |
| MMALIB_QUANT_PER_CHANNEL | |
Definition at line 171 of file c7604/MMALIB_types.h.
| enum MMALIB_data_type_e |
The enumeration of all data types.
Definition at line 40 of file MMALIB_bufParams.h.
| enum MMALIB_dimension_e |
The enumeration of multidimensional buffer types.
| Enumerator | |
|---|---|
| MMALIB_2D | Two dimensional buffer |
| MMALIB_3D | Three dimensional buffer |
| MMALIB_4D | Four dimensional buffer |
| MMALIB_5D | Five dimensional buffer |
| MMALIB_6D | Six dimensional buffer |
Definition at line 73 of file MMALIB_bufParams.h.
| enum MMALIB_STATUS_NAME |
The enumeration of all status codes.
Definition at line 173 of file MMALIB_types.h.
Enumeration for the style of function implementation.
| Enumerator | |
|---|---|
| MMALIB_FUNCTION_NATC | Natural C implementation of the function |
| MMALIB_FUNCTION_OPTIMIZED | Optimized C implementation of the function for the MMA + C7x architecture |
| MMALIB_FUNCTION_MAX | |
Definition at line 287 of file MMALIB_types.h.
| enum MMALIB_buffer_mode_e |
Buffer structure for input feature maps and coefficients of MMALIB_CNN_convolve_row_ixX_ixX_oxX.
| Enumerator | |
|---|---|
| MMALIB_LINEAR | Linear buffer. |
| MMALIB_SE_CIRCULAR | Circular buffer for input feature map managed by streaming engine |
| MMALIB_BUF_CIRCULAR | Circular buffer for coefficients. |
Definition at line 296 of file MMALIB_types.h.
Tensor format.
| Enumerator | |
|---|---|
| MMALIB_CHW | Used when tensor is in NCHW format. |
| MMALIB_HWC | Used when tensor is in NHWC format. |
Definition at line 304 of file MMALIB_types.h.
| enum MMALIB_LUT_type_e |
The enumeration of possible look-up table (LUT) settings.
| Enumerator | |
|---|---|
| MMALIB_LUT_NONE | No lookup table post processing. |
Definition at line 312 of file MMALIB_types.h.
| enum MMALIB_broadcast_e |
The enumeration of possible broadcast.
Definition at line 319 of file MMALIB_types.h.
|
inlinestatic |
Definition at line 162 of file MMALIB_bufParams.h.
|
static |
Inline function returns number of bytes per element given a type of MMALIB_data_type_e.
Definition at line 145 of file MMALIB_bufParams.h.