MMALIB User Guide
MMALIB_CNN_fullyConnectedBias_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_fullyConnectedBias_ixX_ixX_oxX_reorderWeights.h
14 *
15 * @brief Public header file for MMALIB_CNN_fullyConnectedBias_ixX_ixX_oxX_reorderWeights
16 * function
17 *
18 * @version 0.1 - Jan 2023 : Initial Version
19 *
20 ********************************************************************************/
21 
22 
23 #ifndef MMALIB_CNN_FULLYCONNECTEDBIAS_REORDER_WEIGHTS_H_
24 #define MMALIB_CNN_FULLYCONNECTEDBIAS_REORDER_WEIGHTS_H_
25 
26 #include "../../common/MMALIB_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #if defined(__SE_FEAT_SPARSITY)
33 #define INDICATOR_BITS 64
34 #define PACKET_ROWS INDICATOR_BITS/__MMA_A_COLS(1)
35 
36 #if PACKET_ROWS == 1
37 #define PACKET_ROWS_SHIFT 0
38 #define PACKET_ROWS_MASK 0x0ULL
39 #elif PACKET_ROWS == 2
40 #define PACKET_ROWS_SHIFT 1
41 #define PACKET_ROWS_MASK 0x1ULL
42 #elif PACKET_ROWS == 4
43 #define PACKET_ROWS_SHIFT 2
44 #define PACKET_ROWS_MASK 0x3ULL
45 #endif
46 #endif
47 
48 
57 typedef struct
58 {
59  uint32_t data_type;
60  uint32_t dim_x;
61  uint32_t dim_y;
62  int32_t stride_y;
63  int8_t funcStyle;
64 #if defined (__SE_FEAT_SPARSITY)
65  int8_t packetizeMode;
66 #endif
68 
69 
93  int32_t mmaSize,
94  int32_t NiBias,
95  int32_t No,
96  uint32_t strideOut,
97  const void *restrict pWeights,
98  void *restrict pReorderWeights);
99 
116  const void *restrict pWeights);
117 
118 
140  const void *restrict pWeights, // natural order for kernel weights
141  void *restrict pReordered_Weights); // weights reordered for this kernel
142 
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 #endif
148 
MMALIB_STATUS MMALIB_CNN_fullyConnectedBias_processWeights_reorder(const MMALIB_CNN_fullyConnectedBias_processWeights_Args *pArgs, const void *restrict pWeights, void *restrict pReordered_Weights)
This function takes a set of weights and reorders them for use in computing convolve row flow convolu...
MMALIB_STATUS MMALIB_CNN_fullyConnectedBias_ixX_ixX_oxX_reorderWeights(int32_t mmaSize, int32_t NiBias, int32_t No, uint32_t strideOut, const void *restrict pWeights, void *restrict pReorderWeights)
This function re-orders the input weights (kernel matrix). Reordering of data is required to alleviat...
int32_t MMALIB_CNN_fullyConnectedBias_processWeights_getMemorySize(const MMALIB_CNN_fullyConnectedBias_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.
int8_t funcStyle
Variant of the function refer to MMALIB_FUNCTION_STYLE.