![]() |
MMALIB User Guide
|
This module consists of definitions (macros, structures, utility functions) that are commonly applicable to all MMALIB kernels.
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... | |
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 64 |
| MMA width in bytes. 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_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_MMA_SIZE_8_BIT |
| MMA size as a function of precision. More... | |
| #define | MMALIB_MMA_SIZE_16_BIT |
| type is 16-bit integers More... | |
| #define | MMALIB_MMA_SIZE_32_BIT |
| type is 32-bit integers More... | |
| #define MMALIB_ISSIGNED | ( | type | ) | ((type) < MMALIB_UINT8 || (type) > MMALIB_UINT128) |
Definition at line 70 of file MMALIB_bufParams.h.
| #define MMALIB_SIGNEDNESS | ( | type | ) | (MMALIB_ISSIGNED((type)) ? "signed" : "unsigned") |
Definition at line 71 of file MMALIB_bufParams.h.
| #define MMALIB_PARAM_SIZE 128 |
Parameter structure size in bytes.
Definition at line 198 of file MMALIB_types.h.
| #define MMALIB_BYTE_WIDTH 64 |
MMA width in bytes.
Definition at line 199 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_64BYTES 6 |
Number of bits to shift for 64-byte memory alignment.
Definition at line 207 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_128BYTES 7 |
Number of bits to shift for 128-byte memory alignment.
Definition at line 209 of file MMALIB_types.h.
| #define MMALIB_ALIGN_SHIFT_256BYTES 8 |
Number of bits to shift for 256-byte memory alignment.
Definition at line 211 of file MMALIB_types.h.
| #define MMALIB_ALIGN_64BYTES (1 << MMALIB_ALIGN_SHIFT_64BYTES) |
Align by 64-byte memory alignment.
Definition at line 214 of file MMALIB_types.h.
| #define MMALIB_ALIGN_128BYTES (1 << MMALIB_ALIGN_SHIFT_128BYTES) |
Align by 128-byte memory alignment.
Definition at line 216 of file MMALIB_types.h.
| #define MMALIB_ALIGN_256BYTES (1 << MMALIB_ALIGN_SHIFT_256BYTES) |
Align by 256-byte memory alignment.
Definition at line 218 of file MMALIB_types.h.
| #define MMALIB_L2DATA_ALIGN_SHIFT MMALIB_ALIGN_SHIFT_64BYTES |
Set the default L2 data alignment.
Definition at line 221 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 226 of file 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 234 of file 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 238 of file 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 240 of file 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 242 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_8_BIT |
MMA size as a function of precision.
Shift for MMA size when data type is 8-bit integers
Definition at line 247 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_16_BIT |
type is 16-bit integers
Shift for MMA size when data
Definition at line 251 of file MMALIB_types.h.
| #define MMALIB_MMA_SIZE_32_BIT |
type is 32-bit integers
Shift for MMA size when data
Definition at line 255 of file MMALIB_types.h.
| typedef double MMALIB_D64 |
Double precision floating point.
Definition at line 136 of file MMALIB_types.h.
| typedef float MMALIB_F32 |
Single precision floating point.
Definition at line 137 of file MMALIB_types.h.
| typedef MMALIB_STATUS_NAME MMALIB_STATUS |
Return value for MMALIB functions.
Definition at line 162 of file MMALIB_types.h.
| typedef void* MMALIB_kernelHandle |
Handle type for MMALIB operations.
Definition at line 164 of file MMALIB_types.h.
| enum MMALIB_data_type_e |
The enumeration of all data types.
Definition at line 41 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 74 of file MMALIB_bufParams.h.
| enum MMALIB_STATUS_NAME |
The enumeration of all status codes.
Definition at line 140 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 167 of file MMALIB_types.h.
The enumeration of possible activation operations on the computation.
Definition at line 176 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 185 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 140 of file MMALIB_bufParams.h.