41 template <
typename dataType,
typename accumulateType>
48 printf(
"Enter DSPLIB_fir_exec_cn\n");
52 dataType outProd, outTemp;
53 dataType *pInLocal = (dataType *) pIn;
54 dataType *pFilterLocal = (dataType *) pFilter;
55 dataType *pOutLocal = (dataType *) pOut;
66 printf(
"Enter pFilter %p\n", pFilterLocal);
68 int32_t dataOffset = 0;
69 int32_t dataOffsetOut = 0;
71 uint32_t filterPitch = (enableNchCoefs == 0) ? 0 : pKerPrivArgs->
filterPitch;
73 for (l = 0; l < batchSize; l++) {
74 for (j = 0; j < outputSize; j++) {
76 dataOffset = l * dataBufferInPitch + j;
77 dataOffsetOut = l * dataBufferOutPitch + j;
78 int32_t filterCtr = 0;
79 for (k = filterSize - 1; k > -1; k--) {
80 outProd = pInLocal[dataOffset + filterCtr] * pFilterLocal[k];
81 outTemp = outTemp + outProd;
93 pOutLocal[dataOffsetOut] = outTemp;
101 pFilterLocal += filterPitch;
110 void *restrict pFilter,
111 void *restrict pOut);
115 void *restrict pFilter,
116 void *restrict pOut);
120 void *restrict pFilter,
121 void *restrict pOut);
124 void *restrict pFilter,
125 void *restrict pOut);
template DSPLIB_STATUS DSPLIB_fir_exec_cn< int16_t, int64_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_fir_exec_cn< int8_t, int32_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
DSPLIB_STATUS DSPLIB_fir_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
DSPLIB_STATUS DSPLIB_fir_init_cn(DSPLIB_kernelHandle handle, DSPLIB_bufParams2D_t *bufParamsIn, DSPLIB_bufParams2D_t *bufParamsFilter, DSPLIB_bufParams2D_t *bufParamsOut, DSPLIB_fir_InitArgs *pKerInitArgs)
This function is the initialization function for the natural C implementation of the kernel....
template DSPLIB_STATUS DSPLIB_fir_exec_cn< int32_t, DSPLIB_int128_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_fir_exec_cn< float, int32_t >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilter, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_fir.
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
uint32_t enableNchCoefs
Flag to enable per channel filter coefficients: 0 => same coefficients for all channels in batch 1 =>...
int32_t batchSize
Size of batch in terms of number of channels of input data
int32_t filterSize
Size of filter
Structure that is reserved for internal use by the kernel.
uint32_t dataBufferOutPitch
Pitch of output buffer for different batches DSPLIB_fir_init that will be retrieved and used by DSPLI...
uint32_t filterPitch
Pitch of filter coefficient buffer for different batches DSPLIB_fir_init that will be retrieved and u...
uint32_t dataBufferInPitch
Pitch of input buffer for different batches DSPLIB_fir_init that will be retrieved and used by DSPLIB...
DSPLIB_fir_InitArgs initArgs
Structure holding initialization parameters