FFTLIB User Guide
FFTLIB_FFT_dftSmall_ixX_cxX_oxX_cn.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2 **+--------------------------------------------------------------------------+**
3 **| **** |**
4 **| **** |**
5 **| ******o*** |**
6 **| ********_///_**** |**
7 **| ***** /_//_/ **** |**
8 **| ** ** (__/ **** |**
9 **| ********* |**
10 **| **** |**
11 **| *** |**
12 **| |**
13 **| Copyright (c) 2016 Texas Instruments Incorporated |**
14 **| ALL RIGHTS RESERVED |**
15 **| |**
16 **| Permission to use, copy, modify, or distribute this software, |**
17 **| whether in part or in whole, for any purpose is forbidden without |**
18 **| a signed licensing agreement and NDA from Texas Instruments |**
19 **| Incorporated (TI). |**
20 **| |**
21 **| TI makes no representation or warranties with respect to the |**
22 **| performance of this computer program, and specifically disclaims |**
23 **| any responsibility for any damages, special or consequential, |**
24 **| connected with the use of this program. |**
25 **| |**
26 **+--------------------------------------------------------------------------+**
27 *******************************************************************************/
28 
29 
31 
33  FFTLIB_kernelHandle handle,
34  FFTLIB_bufParams1D_t *bufParamsX,
35  FFTLIB_bufParams1D_t *bufParamsW,
36  FFTLIB_bufParams1D_t *bufParamsY,
38 {
40 
41  return status;
42 }
43 
44 template <typename dataType, typename accumulateType, uint32_t MMA_SIZE>
46  FFTLIB_kernelHandle handle,
47  const void *restrict pX,
48  const void *restrict pW,
49  void *restrict pY)
50 {
52  uint32_t j, k, l;
53  accumulateType yProd, yTemp;
54  const dataType *pXLocal = (const dataType *)pX;
55  const dataType *pWLocal = (const dataType *)pW;
56  dataType *pYLocal = (dataType *)pY;
59  uint32_t fftSize = pKerPrivArgs->initArgs.fftSize;
60  uint32_t batchSize = pKerPrivArgs->initArgs.batchSize;
61  uint32_t shift = pKerPrivArgs->initArgs.shiftVector[0];
62 
63  for (l = 0; l < batchSize; l++) {
64  for (j = 0; j < fftSize*2; j++) {
65  yTemp = 0;
66  for (k = 0; k < fftSize*2; k++) {
67  yProd = FFTLIB_UTIL_mult(pXLocal[l*fftSize*2+k], pWLocal[MMA_SIZE*k+j]);
68  yTemp = yTemp + yProd;
69  }
70  pYLocal[l*fftSize*2+j] = FFTLIB_UTIL_shiftAndRound<accumulateType, dataType>(yTemp,
71  shift);
72  }
73  }
74  return (status);
75 }
76 
77 // explicit instantiation for the different data type versions
78 /* Check the template parameter values here */
80  FFTLIB_kernelHandle handle,
81  const void *restrict pX,
82  const void *restrict pW,
83  void *restrict pY);
84 
85 /* Check the template parameter values here */
87  FFTLIB_kernelHandle handle,
88  const void *restrict pX,
89  const void *restrict pW,
90  void *restrict pY);
FFTLIB_STATUS FFTLIB_FFT_dftSmall_ixX_cxX_oxX_init_cn(FFTLIB_kernelHandle handle, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_bufParams1D_t *bufParamsY, FFTLIB_FFT_dftSmall_ixX_cxX_oxX_InitArgs *pKerInitArgs)
This function is the initialization function for the natural C implementation of the kernel....
template FFTLIB_STATUS FFTLIB_FFT_dftSmall_ixX_cxX_oxX_exec_cn< int32_t, FFTLIB_int128_t, FFTLIB_MMA_SIZE_32_BIT >(FFTLIB_kernelHandle handle, const void *restrict pX, const void *restrict pW, void *restrict pY)
FFTLIB_STATUS FFTLIB_FFT_dftSmall_ixX_cxX_oxX_exec_cn(FFTLIB_kernelHandle handle, const void *restrict pX, const void *restrict pW, void *restrict pY)
This function is the main execution function for the natural C implementation of the kernel....
template FFTLIB_STATUS FFTLIB_FFT_dftSmall_ixX_cxX_oxX_exec_cn< int16_t, int64_t, FFTLIB_MMA_SIZE_16_BIT >(FFTLIB_kernelHandle handle, const void *restrict pX, const void *restrict pW, void *restrict pY)
Header file for kernel's internal use. For the kernel's interface, please see FFTLIB_FFT_dftSmall_ixX...
void * FFTLIB_kernelHandle
Handle type for FFTLIB operations.
Definition: FFTLIB_types.h:217
FFTLIB_STATUS_NAME
The enumeration of all status codes.
Definition: FFTLIB_types.h:172
@ FFTLIB_SUCCESS
Definition: FFTLIB_types.h:173
static void FFTLIB_UTIL_mult(int64_t *ph, int64_t *pl, int64_t a, int64_t b)
Structure containing the parameters for DFT computation.
uint32_t shiftVector[FFTLIB_FFT_DFTSMALL_IXX_CXX_OXX_NUMSHIFTS]
Array containing the bit-shift values to be used for internal computation.
uint32_t fftSize
Size of each channel's data in terms of number of complex points.
uint32_t batchSize
Size of the batch in terms of number of channels of DFT's
Structure that is reserved for internal use by the kernel.
FFTLIB_FFT_dftSmall_ixX_cxX_oxX_InitArgs initArgs
Structure holding initialization parameters
A structure for a 1 dimensional buffer descriptor.