12 #ifndef COMMON_DSPLIB_TYPES_H_
13 #define COMMON_DSPLIB_TYPES_H_ 1
17 #ifndef __OPENCL_VERSION__
32 #if !defined(DSPLIB_DEBUGPRINT)
33 #define DSPLIB_DEBUGPRINT 0
36 #if (defined(_HOST_BUILD) && (DSPLIB_COMPILER_VERSION < 1003999))
39 #define DSPLIB_const const
42 #define __PRAGMA(x) _Pragma(#x)
44 #define __INLINE_FUNC(x) __PRAGMA(FUNC_ALWAYS_INLINE)
46 #define __INLINE_FUNC(x) __PRAGMA(FUNC_ALWAYS_INLINE(x))
55 #define DSPLIB_PRINTF(fmt, ...) fprintf(stdout, fmt, __VA_ARGS__);
57 #if DSPLIB_DEBUGPRINT > 0
58 #define DSPLIB_DEBUGPRINTFN(N, fmt, ...) \
60 if (DSPLIB_DEBUGPRINT >= (N)) { \
61 fprintf(stdout, "DSPLIB debug %s - %d: " fmt, __FUNCTION__, __LINE__, __VA_ARGS__); \
67 #define DSPLIB_DEBUGPRINTFN(N, fmt, ...)
73 #if DSPLIB_DEBUGPRINT > 0
74 #define DSPLIB_DEBUGPRINTFN(N, fmt, ...) \
75 if (DSPLIB_DEBUGPRINT >= (N)) { \
76 fprintf(stdout, "DSPLIB debug %s - %d: " fmt, __FUNCTION__, __LINE__, __VA_ARGS__); \
79 #define DSPLIB_PRINTF(fmt, ...) fprintf(stdout, fmt, __VA_ARGS__)
83 #define DSPLIB_DEBUGPRINTFN(N, fmt, ...)
84 #define DSPLIB_PRINTF(fmt, ...)
89 #if defined(DSPLIB_MESSAGES)
93 #define DSPLIB_MESG(fmt, ...) fprintf(stdout, fmt, __VA_ARGS__)
95 #define DSPLIB_MESG(fmt, ...)
116 #define DSPLIB_SOFT_MMA_RESET 0
120 #define DSPLIB_STATIC_INLINE static inline
123 #include <c7x_scalable.h>
125 extern const c7x::uchar_vec DSPLIB_zeroVect_uchar_vec;
126 extern const c7x::ushort_vec DSPLIB_zeroVect_ushort_vec;
127 extern const c7x::uchar_vec DSPLIB_vperm_data_0_63;
188 #define DSPLIB_PARAM_SIZE 128
196 #define DSPLIB_ALIGN_SHIFT_64BYTES 6
197 #define DSPLIB_ALIGN_SHIFT_128BYTES 7
198 #define DSPLIB_ALIGN_SHIFT_256BYTES 8
200 #define DSPLIB_ALIGN_64BYTES (1 << DSPLIB_ALIGN_SHIFT_64BYTES)
201 #define DSPLIB_ALIGN_128BYTES (1 << DSPLIB_ALIGN_SHIFT_128BYTES)
202 #define DSPLIB_ALIGN_256BYTES (1 << DSPLIB_ALIGN_SHIFT_256BYTES)
204 #define DSPLIB_L2DATA_ALIGN_SHIFT DSPLIB_ALIGN_SHIFT_64BYTES
208 #define DSPLIB_L2DATA_ALIGNMENT (((uint32_t) 1) << ((uint32_t) DSPLIB_L2DATA_ALIGN_SHIFT))
232 #if defined(QT_TEST) || defined(RTL_TEST) || defined(EVM_TEST)
233 #if defined(_HOST_BUILD)
234 #define DSPLIB_asm(string) ;
236 #define DSPLIB_asm(string) \
241 #define DSPLIB_asm(string) ;
251 #if defined(_HOST_BUILD)
253 #define xstr(x) str(x)
255 #define __attribute__()
256 #define DSPLIB_UNROLL(count)
258 #define DSPLIB_UNROLL(count) _Pragma(str(UNROLL(count)))
261 #define DSPLIB_UNROLL(COUNT) [[TI::unroll(COUNT)]]
264 #if defined(_HOST_BUILD)
266 #define __attribute__()
267 #define DSPLIB_MUST_ITERATE(initial, max, multiple)
269 #define DSPLIB_MUST_ITERATE(initial, max, multiple) _Pragma(str(MUST_ITERATE(initial, max, multiple)))
272 #define DSPLIB_MUST_ITERATE(INTIAL, MAX, MULTIPLE) [[TI::must_iterate(INTIAL, MAX, MULTIPLE)]]
275 #ifndef DSPLIB_NUMBER_RANDOM_DIM_TESTS
276 #define DSPLIB_NUMBER_RANDOM_DIM_TESTS 25
279 #if defined(PERFORMANCE_TEST)
280 #define DSPLIB_PERFORMANCE_TEST_PATTERN SEQUENTIAL
282 #define DSPLIB_PERFORMANCE_TEST_PATTERN RANDOM_SIGNED
285 #define DSPLIB_TEST_OUTPUT_HEAP 0
286 #if defined(_HOST_BUILD)
290 #define DSPLIB_TEST_OUTPUT_MSMC DSPLIB_TEST_OUTPUT_HEAP
292 #define DSPLIB_TEST_OUTPUT_MSMC 1
295 #define STRIDE_OPT_4CYCLE 1
302 #define DSPLIB_BYTE_WIDTH 32
303 #define DSPLIB_CALC_STRIDE(BYTES, ALIGN_SHIFT) (((((BYTES) -1) >> (ALIGN_SHIFT)) + 1) << (ALIGN_SHIFT))
316 #define DSPLIB_min(x, y) (((x) < (y)) ? (x) : (y))
317 #define DSPLIB_max(x, y) (((x) < (y)) ? (y) : (x))
318 #define DSPLIB_ceilingDiv(x, y) \
319 (((x) + (y) -1) / (y))
DSPLIB_FUNCTION_STYLE
Enumeration for the style of function implementation.
DSPLIB_STATUS_NAME DSPLIB_STATUS
Return value for DSPLIB functions.
double DSPLIB_D64
Double precision floating point.
DSPLIB_STATUS_NAME
The enumeration of all status codes.
float DSPLIB_F32
Single precision floating point.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
@ DSPLIB_FUNCTION_OPTIMIZED
@ DSPLIB_ERR_INVALID_ACTIVATION
@ DSPLIB_ERR_INVALID_SHIFT
@ DSPLIB_ERR_BUFFER_TOO_SMALL
@ DSPLIB_ERR_INVALID_VALUE
@ DSPLIB_ERR_NOT_EQUAL_WIDTH_STRIDE
@ DSPLIB_ERR_INVALID_DIMENSION
@ DSPLIB_ERR_NULL_POINTER
@ DSPLIB_ERR_NOT_IMPLEMENTED
@ DSPLIB_ERR_INVALID_TYPE
@ DSPLIB_ERR_NOT_ALIGNED_PTRS_STRIDES
@ DSPLIB_ERR_NOT_ALIGNED_WIDTHS