![]() |
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) |
| Inline function returns number of bytes per element given a type of MMALIB_data_type_e. More... | |
Typedefs | |
| typedef double | MMALIB_D64 |
| Double precision floating point. More... | |
| typedef float | MMALIB_F32 |
| Single precision floating point. More... | |
| typedef MMALIB_STATUS_NAME | MMALIB_STATUS |
| Return value for MMALIB functions. More... | |
| typedef void * | MMALIB_kernelHandle |
| Handle type for MMALIB operations. More... | |
| typedef MMALIB_tensor_format_e | MMALIB_tensor_format |
Macros | |
| #define | MMALIB_ISSIGNED(type) ((type) < MMALIB_UINT8 || (type) > MMALIB_UINT128) |
| #define | MMALIB_SIGNEDNESS(type) (MMALIB_ISSIGNED((type)) ? "signed" : "unsigned") |
| #define | MMALIB_PARAM_SIZE 128 |
| Parameter structure size in bytes. 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_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 128 |
Parameter structure size in bytes.
Definition at line 288 of file MMALIB_types.h.
| #define MMALIB_BYTE_WIDTH __MMA_A_COLS(sizeof(int8_t)) |
MMA width in bytes.
Definition at line 289 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 290 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 291 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 292 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_64BYTES 6 |
Number of bits to shift for 64-byte memory alignment.
Definition at line 301 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_128BYTES 7 |
Number of bits to shift for 128-byte memory alignment.
Definition at line 303 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_256BYTES 8 |
Number of bits to shift for 256-byte memory alignment.
Definition at line 305 of file MMALIB_types.h.
| #define MMALIB_ALIGN_64BYTES (1 << MMALIB_ALIGN_SHIFT_64BYTES) |
Align by 64-byte memory alignment.
Definition at line 308 of file MMALIB_types.h.
| #define MMALIB_ALIGN_128BYTES (1 << MMALIB_ALIGN_SHIFT_128BYTES) |
Align by 128-byte memory alignment.
Definition at line 310 of file MMALIB_types.h.
| #define MMALIB_ALIGN_256BYTES (1 << MMALIB_ALIGN_SHIFT_256BYTES) |
Align by 256-byte memory alignment.
Definition at line 312 of file MMALIB_types.h.
| #define MMALIB_L2DATA_ALIGN_SHIFT MMALIB_ALIGN_SHIFT_64BYTES |
Set the default L2 data alignment.
Definition at line 315 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 320 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 329 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_16_BIT __MMA_A_COLS(sizeof(int16_t)) |
Definition at line 330 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_32_BIT __MMA_A_COLS(sizeof(int32_t)) |
Definition at line 331 of file MMALIB_types.h.
| #define MMALIB_MMA_BIAS_SIZE_32_BIT __MMA_A_COLS(sizeof(int32_t)) |
Definition at line 334 of file MMALIB_types.h.
| #define MMALIB_MMA_BIAS_SIZE_64_BIT ((MMALIB_MMA_BIAS_SIZE_32_BIT) >> 1) |
Definition at line 335 of file MMALIB_types.h.
| typedef double MMALIB_D64 |
Double precision floating point.
Definition at line 148 of file MMALIB_types.h.
| typedef float MMALIB_F32 |
Single precision floating point.
Definition at line 149 of file MMALIB_types.h.
| typedef MMALIB_STATUS_NAME MMALIB_STATUS |
Return value for MMALIB functions.
Definition at line 253 of file MMALIB_types.h.
| typedef void* MMALIB_kernelHandle |
Handle type for MMALIB operations.
Definition at line 255 of file MMALIB_types.h.
Definition at line 280 of file 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 152 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 258 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 267 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 275 of file MMALIB_types.h.
|
inlinestatic |
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.