56 template <
typename dataType>
65 const int32_t strideOrder,
66 const int32_t strideP)
72 int32_t dataSize =
sizeof(dataType);
73 int32_t dataSizeP =
sizeof(
unsigned short);
75 int32_t orderStride = strideOrder / dataSize;
76 int32_t orderPStride = strideP / dataSizeP;
79 for (row = 0; row < order; row++) {
81 for (col = 0; col < order; col++) {
82 sum += P[col + row * orderPStride] * B[col];
88 for (row = 0; row < order; row++) {
90 Y[row] = B_Mod[row] / L[0];
94 for (col = 0; col <= row - 1; col++){
95 sum += L[row * orderStride + col] * Y[col];
97 Y[row] = (B_Mod[row] - sum) / L[row * orderStride + row];
102 for (row = order - 1; row >= 0; row--) {
103 if (row == order - 1) {
104 X[row] = Y[row] / U[row * orderStride + row];
108 for (col = order - 1; col >= row + 1; col--){
109 sum += U[row * orderStride + col] * X[col];
111 X[row] = (Y[row] - sum) / U[row * orderStride + row];
127 const int32_t strideOrder,
128 const int32_t strideP);
137 const int32_t strideOrder,
138 const int32_t strideP);
140 template <
typename dataType>
147 void *restrict pVecScratch,
148 void *restrict pScratchTrans)
156 int32_t order = pKerPrivArgs->
order;
158 int32_t strideP = pKerPrivArgs->
strideP;
159 int32_t strideVec = pKerPrivArgs->
strideVec;
162 unsigned short *pPLocal = (
unsigned short *) pP;
163 dataType * pLLocal = (dataType *) pL;
164 dataType * pULocal = (dataType *) pU;
165 dataType * pBLocal = (dataType *) pB;
166 dataType * pB_ModLocal = (dataType *) pVecScratch;
167 dataType * pYLocal = (dataType *) (pVecScratch) + (strideVec /
sizeof(dataType));
168 dataType * pXLocal = (dataType *) pX;
171 "pPLocal: %p pLLocal: %p pULocal: %p pBLocal: %p pB_ModLocal: %p pYLocal: %p pXLocal: %p\n",
172 pPLocal, pLLocal, pULocal, pBLocal, pB_ModLocal, pYLocal, pXLocal);
174 DSPLIB_lud_sol_cn<dataType>(order, pPLocal, pLLocal, pULocal, pBLocal, pB_ModLocal, pYLocal, pXLocal, strideOrder,
188 void *restrict pVecScratch,
189 void *restrict pScratchTrans);
197 void *restrict pVecScratch,
198 void *restrict pScratchTrans);
template int DSPLIB_lud_sol_cn< float >(int32_t order, unsigned short *P, float *L, float *U, float *B, float *B_Mod, float *Y, float *X, const int32_t strideOrder, const int32_t strideP)
template DSPLIB_STATUS DSPLIB_lud_sol_exec_cn< float >(DSPLIB_kernelHandle handle, void *restrict pP, void *restrict pL, void *restrict pU, void *restrict pB, void *restrict pX, void *restrict pVecScratch, void *restrict pScratchTrans)
DSPLIB_STATUS DSPLIB_lud_sol_init_cn(DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsP, const DSPLIB_bufParams2D_t *bufParamsL, const DSPLIB_bufParams2D_t *bufParamsU, const DSPLIB_bufParams1D_t *bufParamsB, const DSPLIB_bufParams1D_t *bufParamsX, const DSPLIB_bufParams2D_t *bufParamsVecScratch, const DSPLIB_bufParams2D_t *bufParamsScratchTrans, const DSPLIB_lud_solInitArgs *pKerInitArgs)
This function is the initialization function for the natural C implementation of the kernel....
int DSPLIB_lud_sol_cn(int32_t order, unsigned short *P, dataType *L, dataType *U, dataType *B, dataType *B_Mod, dataType *Y, dataType *X, const int32_t strideOrder, const int32_t strideP)
template int DSPLIB_lud_sol_cn< double >(int32_t order, unsigned short *P, double *L, double *U, double *B, double *B_Mod, double *Y, double *X, const int32_t strideOrder, const int32_t strideP)
template DSPLIB_STATUS DSPLIB_lud_sol_exec_cn< double >(DSPLIB_kernelHandle handle, void *restrict pP, void *restrict pL, void *restrict pU, void *restrict pB, void *restrict pX, void *restrict pVecScratch, void *restrict pScratchTrans)
DSPLIB_STATUS DSPLIB_lud_sol_exec_cn(DSPLIB_kernelHandle handle, void *restrict pP, void *restrict pL, void *restrict pU, void *restrict pB, void *restrict pX, void *restrict pVecScratch, void *restrict pScratchTrans)
This function is the main execution function for the natural C implementation of the kernel....
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_lud_sol.
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
A structure for a 1 dimensional buffer descriptor.
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
int32_t strideOrder
Stride between rows of input and output data matrix
int32_t order
Size of input buffer for different batches DSPLIB_lud_sol_init that will be retrieved and used by DSP...
int32_t strideP
Stride between rows of input data matrix P
int32_t strideVec
Stride between rows of scratch data matrix