FFTLIB User Guide
c7100/FFTLIB_types.h
Go to the documentation of this file.
1 /******************************************************************************
2  * *
3  * module name :FFTLIB *
4  * *
5  * module descripton :Matrix Multiply Accelerator Library module for C7x+MMA *
6  * *
7  * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ *
8  * ALL RIGHTS RESERVED *
9  * *
10  ******************************************************************************/
11 
23 #ifndef C7100_FFTLIB_TYPES_H_
24 #define C7100_FFTLIB_TYPES_H_ 1
25 
26 #include <c7x.h> // for streaming engine, streaming address gen.
27 #ifdef __cplusplus
28 //#include <c7x_scalable.h> // for device scalability
29 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37 
45 /* @{ */
46 
47 /*******************************************************************************
48  *
49  * TYPEDEFS
50  *
51  ******************************************************************************/
52 
55 typedef enum {
60 } FFTLIB_activation_type_e; // formerly eMMAActivationType;
61 
62 typedef enum {
67 
68 /*******************************************************************************
69  *
70  * DEFINES
71  *
72  ******************************************************************************/
73 
74 #define FFTLIB_BYTE_WIDTH 64
75 
76 
77 /* ---------------------------------------------------------------- */
78 /* MISRAC Rule 4.9(DEFINE.FUNC) Deviation: The advisory is not */
79 /* being addressed */
80 /* ---------------------------------------------------------------- */
83 #define FFTLIB_CALC_STRIDE(BYTES, ALIGN_SHIFT) \
84  (((((BYTES)-1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT))
85 
87 #define FFTLIB_MMA_SIZE_8_BIT_SHIFT \
88  6
89 #define FFTLIB_MMA_SIZE_16_BIT_SHIFT \
90  5
91 #define FFTLIB_MMA_SIZE_32_BIT_SHIFT \
92  4
93 
95 //#define FFTLIB_MMA_SIZE_1_BYTE 1
96 #define FFTLIB_MMA_SIZE_8_BIT \
97  ((uint32_t)(((uint32_t)1) \
98  << FFTLIB_MMA_SIZE_8_BIT_SHIFT))
100 #define FFTLIB_MMA_SIZE_16_BIT \
101  ((uint32_t)(((uint32_t)1) \
102  << FFTLIB_MMA_SIZE_16_BIT_SHIFT))
104 #define FFTLIB_MMA_SIZE_32_BIT \
105  ((int32_t)(((uint32_t)1) \
106  << FFTLIB_MMA_SIZE_32_BIT_SHIFT))
108 
109 /* @} */
110 /*******************************************************************************
111  *
112  * Macros
113  *
114  ******************************************************************************/
115 
116 #ifdef __cplusplus
117 }
118 #endif /* __cplusplus */
119 #endif /* C71000_FFTLIB_TYPES_H_ */
120 
121 /* ======================================================================== */
122 /* End of file: FFTLIB_types.h */
123 /* ======================================================================== */
FFTLIB_quantMethod_type_e
@ FFTLIB_QUANT_PER_KERNEL
@ FFTLIB_QUANT_PER_CHANNEL
FFTLIB_quantMethod_type_e FFTLIB_quantMethod_type
FFTLIB_activation_type_e
The enumeration of possible activation operations on the computation.
@ FFTLIB_RELU
Return result after applying ReLU operation.
@ FFTLIB_NONE
Return result as-is (allow wrapping)
@ FFTLIB_SATURATION
Return result after saturating.
@ FFTLIB_ROUNDING
Return result after rounding.