FFTLIB User Guide
FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX

Introduction

Kernel for computing DFT by using a high-radix variant of the FFT alogrithm.

FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX

     - The size of data for each channel in the batch is assumed to be
     greater than or equal to (MMA vector width)*2, and is assumed to
     be a power of 2.
     - The kernel requires application to provide a pre-generated
     computational matrices along with the input data.<br>
     - The algorithm works by decomposing DFT computation to smaller
     size DFT's stage after stage. In all but the first stage, the
     decomposition factor is (MMA vector width)/2. This decomposition
     factor is chosen so that each row of the decomposition matrix would
     fit one full vector length. The first stage would also use a
     decomposition factor of (MMA vector width)/2 if the data size

(fftSize) is a power of (MMA vector width)/2. In case the data size is not a power of (MMA vector width)/2, the decomposition factor for the first stage is less than (MMA vector width)/2.

Data Structures

struct  FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs
 Structure containing the parameters for DFT computation. More...
 

Functions

int32_t FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getHandleSize (FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *pKerInitArgs)
 This is a query function to calculate the size of internal handle. More...
 
FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getSizes (const FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *pKerInitArgs, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_bufParams1D_t *bufParamsY)
 This is a query function to calculate the sizes of input, output and the computational matrices'(DFT and twiddle factor matrix) buffers. More...
 
FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_twGen (const FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *pKerInitArgs, void *pW, const FFTLIB_bufParams1D_t *bufParamsW)
 This is a utility function that generates the computational matrices (DFT and twiddle factor matrices) into the provided buffer. Part of the twiddle factors and DFT matrices are generated into the FFTLIB_FFT_twData buffer that must be mapped to L1D memory for optimal performance. Note that this buffer is different from the buffer pointed to by the pW argument that is passed to this function. More...
 
FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init (FFTLIB_kernelHandle handle, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_bufParams1D_t *bufParamsY, FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *pKerInitArgs)
 This function should be called before the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the MMA accelerator and the streaming engine. The results of these operations are stored in the handle. More...
 
FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init_checkParams (FFTLIB_kernelHandle handle, const FFTLIB_bufParams1D_t *bufParamsX, const FFTLIB_bufParams1D_t *bufParamsW, const FFTLIB_bufParams1D_t *bufParamsY, const FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *pKerInitArgs)
 This function checks the validity of the parameters passed to FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init function. This function is called with the same parameters as the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init, and this function must be called before the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init is called. More...
 
FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec (FFTLIB_kernelHandle handle, void *restrict pX, void *restrict pW, void *restrict pY)
 This function is the main kernel compute function. More...
 
FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec_checkParams (FFTLIB_kernelHandle handle, const void *restrict pX, const void *restrict pW, const void *restrict pY)
 This function checks the validity of the parameters passed to FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec function. This function is called with the same parameters as the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec, and this function must be called before the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec is called. More...
 
void FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_perfEst (FFTLIB_kernelHandle handle, const FFTLIB_bufParams1D_t *bufParamsX, const FFTLIB_bufParams1D_t *bufParamsY, const FFTLIB_bufParams1D_t *bufParamsW, uint32_t fftSize, uint32_t batchSize, uint32_t interleave, uint64_t *archCycles, uint64_t *estCycles)
 This is a utility function that gives an estimate of the cycles consumed for the kernel execution. More...
 

Variables

uint8_t FFTLIB_FFT_twData [FFTLIB_MMA_SIZE_16_BIT *FFTLIB_MMA_SIZE_16_BIT *(uint32_t) 3 *sizeof(int16_t)]
 Array that needs to be allocated in L1D to hold part of the computational matrix data. More...
 

Macros

#define FFTLIB_FFT_HIGHRADIXDECOMPOSITIONS_IXX_CXX_OXX_NUMSHIFTS   5
 Macro to define the number of bit-shifts that are to be provided for use in the internal computation. More...
 

Macro Definition Documentation

◆ FFTLIB_FFT_HIGHRADIXDECOMPOSITIONS_IXX_CXX_OXX_NUMSHIFTS

#define FFTLIB_FFT_HIGHRADIXDECOMPOSITIONS_IXX_CXX_OXX_NUMSHIFTS   5

Macro to define the number of bit-shifts that are to be provided for use in the internal computation.

The number of bit-shifts depends on the number of stages of computation - that is number of decomposition stages. Assuming a maximum data size of 32768 in case of 32-bit data type, maximum number of computation stages would be 5. (log(32768) base 8)

Definition at line 122 of file FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX.h.

Function Documentation

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getHandleSize()

int32_t FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getHandleSize ( FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *  pKerInitArgs)

This is a query function to calculate the size of internal handle.

Parameters
[in]pKerInitArgs: Pointer to structure holding init parameters
Returns
Size of the buffer in bytes
Remarks
Application is expected to allocate buffer of the requested size and provide it as input to other functions requiring it.

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getSizes()

FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getSizes ( const FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *  pKerInitArgs,
FFTLIB_bufParams1D_t *  bufParamsX,
FFTLIB_bufParams1D_t *  bufParamsW,
FFTLIB_bufParams1D_t *  bufParamsY 
)

This is a query function to calculate the sizes of input, output and the computational matrices'(DFT and twiddle factor matrix) buffers.

Parameters
[in]pKerInitArgs: Pointer to the structure holding init parameters
[in]bufParamsX: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsW: Pointer to the structure containing dimensional information of computational matrices' buffer
[in]bufParamsY: Pointer to the structure containing dimensional information of ouput buffer
Returns
Status value indicating success or failure. Refer to FFTLIB_STATUS.
Remarks
Application is expected to allocate buffers of the requested size, fill in the input data and computational matrices' data before making the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec function call.

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_twGen()

FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_twGen ( const FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *  pKerInitArgs,
void *  pW,
const FFTLIB_bufParams1D_t *  bufParamsW 
)

This is a utility function that generates the computational matrices (DFT and twiddle factor matrices) into the provided buffer. Part of the twiddle factors and DFT matrices are generated into the FFTLIB_FFT_twData buffer that must be mapped to L1D memory for optimal performance. Note that this buffer is different from the buffer pointed to by the pW argument that is passed to this function.

Parameters
[in]pKerInitArgs: Pointer to the structure holding init parameters
[in]pW: Pointer to the buffer where the computational matrices are generated into.
[in]bufParamsW: Pointer to the structure containing dimensional information of computational matrices' buffer
Returns
Status value indicating success or failure. Refer to FFTLIB_STATUS.
Remarks
pW must point to a buffer of size obtained from the call to FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_getSizes function.

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init()

FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init ( FFTLIB_kernelHandle  handle,
FFTLIB_bufParams1D_t *  bufParamsX,
FFTLIB_bufParams1D_t *  bufParamsW,
FFTLIB_bufParams1D_t *  bufParamsY,
FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *  pKerInitArgs 
)

This function should be called before the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the MMA accelerator and the streaming engine. The results of these operations are stored in the handle.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsX: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsW: Pointer to the structure containing dimensional information of computational matrices' buffer
[out]bufParamsY: Pointer to the structure containing dimensional information of ouput buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to FFTLIB_STATUS.
Remarks
Application is expected to provide a valid handle.

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init_checkParams()

FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init_checkParams ( FFTLIB_kernelHandle  handle,
const FFTLIB_bufParams1D_t *  bufParamsX,
const FFTLIB_bufParams1D_t *  bufParamsW,
const FFTLIB_bufParams1D_t *  bufParamsY,
const FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_InitArgs *  pKerInitArgs 
)

This function checks the validity of the parameters passed to FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init function. This function is called with the same parameters as the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init, and this function must be called before the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init is called.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsX: Pointer to the structure containing dimensional information of input buffer
[in]bufParamsW: Pointer to the structure containing dimensional information of computational matrices'
[out]bufParamsY: Pointer to the structure containing dimensional information of output buffer
[in]pKerInitArgs: Pointer to the structure holding init parameters
Returns
Status value indicating success or failure. Refer to FFTLIB_STATUS.
Remarks
None

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec()

FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec ( FFTLIB_kernelHandle  handle,
void *restrict  pX,
void *restrict  pW,
void *restrict  pY 
)

This function is the main kernel compute function.

Please refer to details under FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX

Parameters
[in]handle: Active handle to the kernel
[in]pX: Pointer to buffer holding the input data
[in]pW: Pointer to buffer holding the computational matrices
[out]pY: Pointer to buffer holding the output data
Returns
Status value indicating success or failure. Refer to FFTLIB_STATUS.
Assumptions:
  • None
Performance Considerations:
For best performance,
  • the input and output data buffers are expected to be in L2 memory
  • the buffer pointers are assumed to be 64-byte aligned
Remarks
Before calling this function, application is expected to call FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_init and FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec_checkParams functions. This ensures resource configuration and error checks are done only once for several invocations of this function.

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec_checkParams()

FFTLIB_STATUS FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec_checkParams ( FFTLIB_kernelHandle  handle,
const void *restrict  pX,
const void *restrict  pW,
const void *restrict  pY 
)

This function checks the validity of the parameters passed to FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec function. This function is called with the same parameters as the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec, and this function must be called before the FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_exec is called.

Parameters
[in]handle: Active handle to the kernel
[in]pX: Pointer to buffer holding the input data
[in]pW: Pointer to buffer holding the computational matrices
[out]pY: Pointer to buffer holding the output matrix
Returns
Status value indicating success or failure. Refer to FFTLIB_STATUS.
Remarks
None

◆ FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_perfEst()

void FFTLIB_FFT_highRadixDecompositions_ixX_cxX_oxX_perfEst ( FFTLIB_kernelHandle  handle,
const FFTLIB_bufParams1D_t *  bufParamsX,
const FFTLIB_bufParams1D_t *  bufParamsY,
const FFTLIB_bufParams1D_t *  bufParamsW,
uint32_t  fftSize,
uint32_t  batchSize,
uint32_t  interleave,
uint64_t *  archCycles,
uint64_t *  estCycles 
)

This is a utility function that gives an estimate of the cycles consumed for the kernel execution.

Parameters
[in]handle: Active handle to the kernel
[in]bufParamsX: Pointer to the structure containing dimensional information of pX
[in]bufParamsY: Pointer to the structure containing dimensional information of pY
[in]bufParamsW: Pointer to the structure containing dimensional information of pW
[in]fftSize: Size of each channel's data in terms of number of complex points
[in]batchSize: Size of the batch in terms of number of channels of DFT's
[in]interleave: Flag to indicate if the real and imaginary parts of data are interleaved or not.
[out]archCycles: Cycles estimated for the compute, startup and teardown
[out]estCycles: Cycles estimated for the compute, startup, teardown and any associated overhead
Remarks
None

Variable Documentation

◆ FFTLIB_FFT_twData

uint8_t FFTLIB_FFT_twData[FFTLIB_MMA_SIZE_16_BIT * FFTLIB_MMA_SIZE_16_BIT *(uint32_t) 3 * sizeof(int16_t)]

Array that needs to be allocated in L1D to hold part of the computational matrix data.