34 template <
typename dataType>
41 int32_t order = pKerPrivArgs->
order;
42 int32_t yStrideCn = pKerPrivArgs->
strideCn /
sizeof(dataType);
43 int32_t yStride = pKerPrivArgs->
stride /
sizeof(dataType);
50 for (i = 0; i < order; i++) {
52 for (j = 0; j < order; j++) {
54 sum += (dataType) A[i * yStride + j] * (dataType) (j + 1);
56 sum1 += (dataType) (i + 1) * sum;
66 for (j = 0; j < order; j++)
70 for (k = 0; k <= j - 1; k++) {
71 sum += U[k * yStrideCn + j] * U[k * yStrideCn + j];
75 U[j * yStrideCn + j] = (dataType) sqrt((dataType) A[j * yStride + j] - sum);
78 for (i = j + 1; i < order; i++) {
80 for (k = 0; k <= j - 1; k++) {
81 sum += U[k * yStrideCn + i] * U[k * yStrideCn + j];
83 U[j * yStrideCn + i] = ((dataType) A[j * yStride + i] - sum) / U[j * yStrideCn + j];
92 template <
typename dataType>
96 void *restrict multiplierPtr)
102 dataType *pInALocal = (dataType *) pInA;
103 dataType *pOutULocal = (dataType *) pOutU;
105 int32_t enable_test = pKerPrivArgs->
enableTest;
115 void *restrict pOutU,
116 void *restrict multiplierPtr);
120 void *restrict pOutU,
121 void *restrict multiplierPtr);
template DSPLIB_STATUS DSPLIB_cholesky_exec_cn< float >(DSPLIB_kernelHandle handle, void *restrict pInA, void *restrict pOutU, void *restrict multiplierPtr)
template DSPLIB_STATUS DSPLIB_cholesky_exec_cn< double >(DSPLIB_kernelHandle handle, void *restrict pInA, void *restrict pOutU, void *restrict multiplierPtr)
DSPLIB_STATUS DSPF_sp_cholesky_cn(int enable_test, DSPLIB_cholesky_PrivArgs *pKerPrivArgs, dataType *A, dataType *U)
DSPLIB_STATUS DSPLIB_cholesky_exec_cn(DSPLIB_kernelHandle handle, void *restrict pInA, void *restrict pOutU, void *restrict multiplierPtr)
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_cholesky.
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Structure that is reserved for internal use by the kernel.
int32_t order
Order of input buffer for different batches DSPLIB_cholesky_init that will be retrieved and used by D...