FFTLIB User Guide
FFTLIB_bufParams.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 
22 #ifndef FFTLIB_BUFPARAMS_H_
23 #define FFTLIB_BUFPARAMS_H_
24 
25 #ifndef __OPENCL_VERSION__
26 #include <stdint.h>
27 #endif
28 
29 
35 /* @{ */
36 
37 static inline int32_t FFTLIB_sizeof(uint32_t type);
38 
40 typedef enum _FFTLIB_data_type_e
41 {
42  /* Standard fixed point data types */
56  /* Standard floating point data types */
59  FFTLIB_FLOAT64 = 13
62 
63 
64 /* ---------------------------------------------------------------- */
65 /* MISRAC Rule 4.9(DEFINE.FUNC) Deviation: The advisory is not */
66 /* being addressed */
67 /* ---------------------------------------------------------------- */
68 // MACRO for determining signedness of FFTLIB data types; fragile in that it depends on ordering of FFTLIB_data_type_e
69 #define FFTLIB_ISSIGNED(type) ((type) < FFTLIB_UINT8 || (type) > FFTLIB_UINT128)
70 #define FFTLIB_SIGNEDNESS(type) (FFTLIB_ISSIGNED((type)) ? "signed" : "unsigned")
71 
73 typedef enum _FFTLIB_dimension_e {
74  FFTLIB_2D= 0,
75  FFTLIB_3D= 1,
76  FFTLIB_4D= 2,
77  FFTLIB_5D= 3,
78  FFTLIB_6D= 4
80 
82 typedef struct
83 {
84  uint32_t data_type;
86  uint32_t dim_x;
89 
91 typedef struct
92 {
93  uint32_t data_type;
95  uint32_t dim_x;
96  uint32_t dim_y;
98  int32_t stride_y;
101 
103 typedef struct
104 {
105  uint32_t data_type;
107  uint32_t dim_x;
109  uint32_t dim_y;
110  int32_t stride_y;
112  uint32_t dim_z;
113  int32_t stride_z;
116 
118 typedef struct
119 {
120  uint32_t data_type;
122  uint32_t dim_0;
123 
124  uint32_t dim_1;
125  int32_t stride_1;
127  uint32_t dim_2;
128  int32_t stride_2;
130  uint32_t dim_3;
131  int32_t stride_3;
133  uint32_t dim_4;
134  int32_t stride_4;
136  uint32_t dim_5;
137  int32_t stride_5;
139  uint32_t dimension;
142 
143 
145 static inline int32_t FFTLIB_sizeof(uint32_t type)
146 {
147 
148  int32_t size = 1;
149 
150  if((type == (uint32_t)FFTLIB_INT8) ||
151  (type == (uint32_t)FFTLIB_UINT8))
152  {
153  size = 1;
154  }
155  else if((type == (uint32_t)FFTLIB_INT16) ||
156  (type == (uint32_t)FFTLIB_UINT16) ||
157  (type == (uint32_t)FFTLIB_FLOAT16))
158  {
159  size = 2;
160  }
161  else if(type == (uint32_t)FFTLIB_UINT24)
162  {
163  size = 3;
164  }
165  else if((type == (uint32_t)FFTLIB_INT32) ||
166  (type == (uint32_t)FFTLIB_UINT32) ||
167  (type == (uint32_t)FFTLIB_FLOAT32))
168  {
169  size = 4;
170  }
171  else if((type == (uint32_t)FFTLIB_INT64) ||
172  (type == (uint32_t)FFTLIB_UINT64) ||
173  (type == (uint32_t)FFTLIB_FLOAT64))
174  {
175  size = 8;
176  }
177  else if((type == (uint32_t)FFTLIB_INT128) ||
178  (type == (uint32_t)FFTLIB_UINT128))
179  {
180  size = 16;
181  }
182  else {
183  size = 1;
184  }
185 
186  return size;
187 }
188 
189 /* @} */
190 #endif /* FFTLIB_BUFPARAMS_H_ */
FFTLIB_dimension_e
The enumeration of multidimensional buffer types.
@ FFTLIB_4D
@ FFTLIB_5D
@ FFTLIB_3D
@ FFTLIB_6D
@ FFTLIB_2D
FFTLIB_data_type_e
The enumeration of all data types.
@ FFTLIB_INT128
@ FFTLIB_INT64
@ FFTLIB_UINT32
@ FFTLIB_INT16
@ FFTLIB_INT8
@ FFTLIB_FLOAT16
@ FFTLIB_UINT16
@ FFTLIB_FLOAT32
@ FFTLIB_UINT8
@ FFTLIB_UINT128
@ FFTLIB_UINT64
@ FFTLIB_INT32
@ FFTLIB_UINT24
@ FFTLIB_FLOAT64
static int32_t FFTLIB_sizeof(uint32_t type)
Inline function returns number of bytes per element given a type of _FFTLIB_data_type_e.
A structure for a 1 dimensional buffer descriptor.
uint32_t data_type
Values are of type FFTLIB_data_type_e.
uint32_t dim_x
Width of buffer in X dimension in elements.
A structure for a 2 dimensional buffer descriptor.
uint32_t dim_y
Height of buffer in Y dimension in elements.
uint32_t dim_x
Width of buffer in X dimension in elements.
int32_t stride_y
Stride in Y dimension in bytes.
uint32_t data_type
Values are of type FFTLIB_data_type_e.
A structure for a 3 dimensional buffer descriptor.
int32_t stride_z
Stride in Z dimension in bytes.
uint32_t dim_x
Width of buffer in X dimension in elements.
uint32_t data_type
Values are of type FFTLIB_data_type_e.
uint32_t dim_z
Depth of patch in Z dimension in elements.
uint32_t dim_y
Height of buffer in Y dimension in elements.
int32_t stride_y
Stride in Y dimension in bytes.
A structure for a N dimensional buffer descriptor.
int32_t stride_3
Stride in bytes; Uninitialized when dimension = {FFTLIB_2D, FFTLIB_3D}.
uint32_t data_type
Values are of type FFTLIB_data_type_e.
uint32_t dim_5
Uninitialized when dimension = {FFTLIB_2D, FFTLIB_3D, FFTLIB_4D, FFTLIB_5D}.
int32_t stride_5
Stride in bytes; Uninitialized when dimension = {FFTLIB_2D, FFTLIB_3D, FFTLIB_4D, FFTLIB_5D}.
int32_t stride_4
Stride in bytes; Uninitialized when dimension = {FFTLIB_2D, FFTLIB_3D, FFTLIB_4D}.
int32_t stride_2
Stride in bytes; Uninitialized when dimension = {FFTLIB_2D}.
uint32_t dim_4
Uninitialized when dimension = {FFTLIB_2D, FFTLIB_3D, FFTLIB_4D}.
int32_t stride_1
Stride in bytes.
uint32_t dim_2
Uninitialized when dimension = {FFTLIB_2D}.
uint32_t dimension
Values are of type FFTLIB_dimension_e.
uint32_t dim_3
Uninitialized when dimension = {FFTLIB_2D, FFTLIB_3D}.