36 template <
typename dataType>
43 typedef typename c7x::make_full_vector<dataType>::type vec;
44 int32_t eleCount = c7x::element_count_of<vec>::value;
46 __SE_ELETYPE SE_ELETYPE = c7x::se_eletype<vec>::value;
47 __SE_VECLEN SE_VECLEN = c7x::se_veclen<vec>::value;
51 int32_t nVec = DSPLIB_ceilingDiv(order, eleCount);
52 int32_t nVecPosCheck2 = nVec / 2;
53 int32_t nVecPosCheck1 = nVec - nVecPosCheck2;
54 __SE_TEMPLATE_v1 sePosCheck1Params = __gen_SE_TEMPLATE_v1();
55 sePosCheck1Params.ICNT0 = eleCount;
56 sePosCheck1Params.ICNT1 = order;
57 sePosCheck1Params.DIM1 = colStride;
58 sePosCheck1Params.ICNT2 = nVecPosCheck1;
59 sePosCheck1Params.DIM2 = eleCount * 2;
60 sePosCheck1Params.DECDIM1 = __SE_DECDIM_DIM2;
61 sePosCheck1Params.DECDIM1_WIDTH = order;
62 sePosCheck1Params.DIMFMT = __SE_DIMFMT_3D;
63 sePosCheck1Params.VECLEN = SE_VECLEN;
64 sePosCheck1Params.ELETYPE = SE_ELETYPE;
67 __SE_TEMPLATE_v1 sePosCheck2Params = __gen_SE_TEMPLATE_v1();
68 sePosCheck2Params.ICNT0 = eleCount;
69 sePosCheck2Params.ICNT1 = order;
70 sePosCheck2Params.DIM1 = colStride;
71 sePosCheck2Params.ICNT2 = nVecPosCheck2;
72 sePosCheck2Params.DIM2 = eleCount * 2;
73 sePosCheck2Params.DECDIM1 = __SE_DECDIM_DIM2;
74 sePosCheck2Params.DECDIM1_WIDTH = order - eleCount;
75 sePosCheck2Params.DIMFMT = __SE_DIMFMT_3D;
76 sePosCheck2Params.VECLEN = SE_VECLEN;
77 sePosCheck2Params.ELETYPE = SE_ELETYPE;
96 template <
typename dataType>
101 __SE_TEMPLATE_v1 sePosCheck1Params, sePosCheck2Params;
105 typedef typename c7x::make_full_vector<dataType>::type vec;
109 int32_t nVec = DSPLIB_ceilingDiv(order, eleCount);
111 vec vZTrans1 = (vec) 1.0;
112 vec vZTrans2 = (vec) 2.0;
113 vec vZTrans3 = (vec) 3.0;
114 vec vZTrans4 = (vec) 4.0;
116 vec vOne = (vec) 1.0;
117 vec vTwo = (vec) 2.0;
118 vec vThree = (vec) 3.0;
119 vec vFour = (vec) 4.0;
120 vec vZero = (vec) 0.0;
131 vec finalSum1 = vZero;
132 vec finalSum2 = vZero;
134 for (int32_t i = 0; i < eleCount; i++) {
135 vZ1.s[i] = (dataType) i;
138 vec vZ2 = vZ1 + eleCount;
140 __SE0_OPEN(A, sePosCheck1Params);
142 __SE1_OPEN(A + eleCount, sePosCheck2Params);
145 int32_t horizontal = 0;
146 int32_t vertical = 0;
147 for (horizontal = 0; horizontal < nVec - 1; horizontal += 2) {
148 for (vertical = 0; vertical < order - 3; vertical += 4) {
150 vec v1 = c7x::strm_eng<0, vec>::get_adv();
151 vec v2 = c7x::strm_eng<1, vec>::get_adv();
152 vec v3 = c7x::strm_eng<0, vec>::get_adv();
153 vec v4 = c7x::strm_eng<1, vec>::get_adv();
154 vec v5 = c7x::strm_eng<0, vec>::get_adv();
155 vec v6 = c7x::strm_eng<1, vec>::get_adv();
156 vec v7 = c7x::strm_eng<0, vec>::get_adv();
157 vec v8 = c7x::strm_eng<1, vec>::get_adv();
159 sum1 += v1 * vZTrans1;
160 sum2 += v2 * vZTrans1;
161 sum3 += v3 * vZTrans2;
162 sum4 += v4 * vZTrans2;
163 sum5 += v5 * vZTrans3;
164 sum6 += v6 * vZTrans3;
165 sum7 += v7 * vZTrans4;
166 sum8 += v8 * vZTrans4;
174 for (; vertical < order; vertical++) {
175 vec v1 = c7x::strm_eng<0, vec>::get_adv();
176 vec v2 = c7x::strm_eng<1, vec>::get_adv();
178 sum1 += v1 * vZTrans1;
179 sum2 += v2 * vZTrans1;
191 finalSum1 += sum1 * vZ1;
192 finalSum2 += sum2 * vZ2;
213 if (horizontal != nVec) {
214 for (vertical = 0; vertical < order - 3; vertical += 4) {
215 vec v1 = c7x::strm_eng<0, vec>::get_adv();
216 vec v3 = c7x::strm_eng<0, vec>::get_adv();
217 vec v5 = c7x::strm_eng<0, vec>::get_adv();
218 vec v7 = c7x::strm_eng<0, vec>::get_adv();
220 sum1 += v1 * vZTrans1;
221 sum3 += v3 * vZTrans2;
222 sum5 += v5 * vZTrans3;
223 sum7 += v7 * vZTrans4;
230 for (; vertical < order; vertical++) {
231 vec v1 = c7x::strm_eng<0, vec>::get_adv();
232 sum1 += v1 * vZTrans1;
240 finalSum1 += sum1 * vZ1;
245 vec finalSum = finalSum1 + finalSum2;
247 c7x_horizontal_add(finalSum, &sum);
#define SE_SE0_PARAM_OFFSET
#define SE_SE1_PARAM_OFFSET
template DSPLIB_STATUS DSPLIB_cholesky_inplace_isPosDefinite_init< double >(int32_t order, int32_t colStride, uint8_t *pBlock)
template double DSPLIB_cholesky_inplace_isPosDefinite< double >(double *A, const int32_t order, const int32_t eleCount, uint8_t *pBlock)
DSPLIB_STATUS DSPLIB_cholesky_inplace_isPosDefinite_init(int32_t order, int32_t colStride, uint8_t *pBlock)
template float DSPLIB_cholesky_inplace_isPosDefinite< float >(float *A, const int32_t order, const int32_t eleCount, uint8_t *pBlock)
template DSPLIB_STATUS DSPLIB_cholesky_inplace_isPosDefinite_init< float >(int32_t order, int32_t colStride, uint8_t *pBlock)
dataType DSPLIB_cholesky_inplace_isPosDefinite(dataType *A, const int32_t order, const int32_t eleCount, uint8_t *pBlock)
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
DSPLIB_STATUS_NAME
The enumeration of all status codes.