MMALIB User Guide
MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_processWeights.h
Go to the documentation of this file.
1 /******************************************************************************
2 * *
3 * module name :MMALIB *
4 * *
5 * module descripton :Matrix Multiply Accelerator Library module for C7x+MMA *
6 * *
7 * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ *
8 * ALL RIGHTS RESERVED *
9 * *
10 ******************************************************************************/
11 
12 /********************************************************************************
13 * @file MMALIB_CNN_convolve_col_smallNo_highPrecision_reorderWeights.h
14 *
15 * @brief Public header file for MMALIB_CNN_convolveBias_row_ixX_ixX_oxX_compressWeights
16 * function
17 *
18 * @version 0.1 - Dec 2018 : Initial Version
19 *
20 ********************************************************************************/
21 
22 
23 #ifndef MMALIB_CNN_CONVOLVEBIAS_ROW_PROCESSWEIGHTS_H_
24 #define MMALIB_CNN_CONVOLVEBIAS_ROW_PROCESSWEIGHTS_H_
25 
26 #include "../../common/MMALIB_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define MMA_SIZE_BLKS 2
33 #define INDICATOR_BITS 64
34 #define SPARSE_BLKS 2
35 #define PACKET_ROWS INDICATOR_BITS/__MMA_A_COLS(1)
36 
37 #if PACKET_ROWS == 1
38 #define PACKET_ROWS_SHIFT 0
39 #define PACKET_ROWS_MASK 0x0ULL
40 #elif PACKET_ROWS == 2
41 #define PACKET_ROWS_SHIFT 1
42 #define PACKET_ROWS_MASK 0x1ULL
43 #elif PACKET_ROWS == 4
44 #define PACKET_ROWS_SHIFT 2
45 #define PACKET_ROWS_MASK 0x3ULL
46 #endif
47 
48 
57 typedef struct
58 {
59  int8_t funcStyle;
60  int32_t data_type;
61  int32_t Fr;
62  int32_t Fc;
63  int32_t pitchA;
64  int32_t numInChPerGroup;
65  int32_t subMChannels;
66  int32_t No;
68  int32_t maxSize;
69  int8_t packetizeMode;
71 
87  const void *restrict pWeights);
88 
110  const void *restrict pWeights, // natural order for kernel weights
111  void *restrict pReorderedWeights); // weights reordered for this kernel
112 
114  const void *restrict pReorderedWeights, // compressed form
115  const void *restrict pWeights); // decompressed output
116 
117 #ifdef __cplusplus
118 }
119 #endif // __cplusplus
120 #endif // #ifndef MMALIB_CNN_CONVOLVEBIAS_ROW_PROCESSWEIGHTS_H_
MMALIB_STATUS MMALIB_CNN_convolveBias_row_processWeights_depacketize(const MMALIB_CNN_convolveBias_row_processWeights_Args *pArgs, const void *restrict pReorderedWeights, const void *restrict pWeights)
MMALIB_STATUS MMALIB_CNN_convolveBias_row_processWeights_reorder(const MMALIB_CNN_convolveBias_row_processWeights_Args *pArgs, const void *restrict pWeights, void *restrict pReorderedWeights)
This function takes a set of weights and reorders them for use in computing convolve row flow convolu...
int32_t MMALIB_CNN_convolveBias_row_processWeights_getMemorySize(MMALIB_CNN_convolveBias_row_processWeights_Args *pArgs, const void *restrict pWeights)
This function returns the amount of memory that needs to be allocated for reordered kernel coefficien...
MMALIB_STATUS_NAME
The enumeration of all status codes.
Definition: MMALIB_types.h:152
This structure holds all the input parameters for reordering CNN filter weights.
int32_t numGroupsPerKernel
Number of groups to be processed in kernel call.
int8_t funcStyle
Variant of the function refer to MMALIB_FUNCTION_STYLE.
int32_t maxSize
Maximum size of reordered subMChannels across all kernel calls. Populated by getMemorySize.
int32_t data_type
Data type must be a member of MMALIB_data_type_e.