24 #include "kernels_trace.h"
26 #ifndef DOXYGEN_SHOULD_SKIP_THIS
27 #define MAXSIZEOFBLOCKS 64
28 static pastix_complex32_t cone = 1.0;
29 static pastix_complex32_t mcone = -1.0;
69 pastix_complex32_t *A,
71 pastix_int_t *nbpivots,
75 pastix_complex32_t *Akk = A;
76 pastix_complex32_t *Amk = A+1;
77 pastix_complex32_t alpha;
80 if ( cabsf(*Akk) < criterion ) {
81 (*Akk) = (pastix_complex32_t)criterion;
86 if ( crealf(*Akk) < 0.0 )
88 pastix_print_error(
"Negative diagonal term\n" );
95 cblas_cscal(n-k-1, CBLAS_SADDR( alpha ), Amk, 1 );
100 cblas_cher(CblasColMajor, CblasLower,
145 pastix_complex32_t *A,
147 pastix_int_t *nbpivots,
150 pastix_int_t k, blocknbr, blocksize, matrixsize;
151 pastix_complex32_t *tmp,*tmp1,*tmp2;
154 blocknbr = pastix_iceil( n, MAXSIZEOFBLOCKS );
156 for (k=0; k<blocknbr; k++) {
158 blocksize = pastix_imin(MAXSIZEOFBLOCKS, n-k*MAXSIZEOFBLOCKS);
159 tmp = A+(k*MAXSIZEOFBLOCKS)*(lda+1);
164 if ((k*MAXSIZEOFBLOCKS+blocksize) < n) {
166 tmp1 = tmp + blocksize;
167 tmp2 = tmp1 + blocksize * lda;
169 matrixsize = n-(k*MAXSIZEOFBLOCKS+blocksize);
175 cblas_ctrsm(CblasColMajor,
176 CblasRight, CblasLower,
177 CblasConjTrans, CblasNonUnit,
178 matrixsize, blocksize,
179 CBLAS_SADDR(cone), tmp, lda,
183 cblas_cherk(CblasColMajor, CblasLower, CblasNoTrans,
184 matrixsize, blocksize,
185 (
float)mcone, tmp1, lda,
186 (
float)cone, tmp2, lda);
224 pastix_int_t ncols, stride;
225 pastix_int_t nbpivots = 0;
226 pastix_fixdbl_t time, flops;
227 pastix_complex32_t *L;
229 float criterion = solvmtx->diagthreshold;
231 time = kernel_trace_start( PastixKernelPOTRF );
234 stride = (cblk->
cblktype & CBLK_LAYOUT_2D) ? ncols : cblk->
stride;
240 if ( cblk->
cblktype & CBLK_COMPRESSED ) {
246 assert( lrL->
rk == -1 );
247 assert( stride == lrL->
rkmax );
249 L = (pastix_complex32_t *)dataL;
253 flops = FLOPS_CPOTRF( ncols );
254 kernel_trace_start_lvl2( PastixKernelLvl2POTRF );
256 kernel_trace_stop_lvl2( flops );
258 kernel_trace_stop( cblk->
fblokptr->
inlast, PastixKernelPOTRF, ncols, 0, 0, flops, time );
261 pastix_atomic_add_32b( &(solvmtx->nbpivots), nbpivots );
296 pastix_int_t nbpivots;
301 cblk, L, L, &(solvmtx->lowrank) );
336 pastix_complex32_t *work,
342 pastix_int_t nbpivots;
350 for( ; blok < lblk; blok++ )
352 fcblk = solvmtx->cblktab + blok->
fcblknm;
354 if ( fcblk->
cblktype & CBLK_FANIN ) {
361 work, lwork, &(solvmtx->lowrank) );
static void core_cpotf2sp(pastix_int_t n, pastix_complex32_t *A, pastix_int_t lda, pastix_int_t *nbpivots, float criterion)
Compute the sequential static pivoting Cholesky factorization of the matrix n-by-n A = L * L^t .
void core_cpotrfsp(pastix_int_t n, pastix_complex32_t *A, pastix_int_t lda, pastix_int_t *nbpivots, float criterion)
Compute the block static pivoting Cholesky factorization of the matrix n-by-n A = L * L^t .
pastix_fixdbl_t cpucblk_cgemmsp(pastix_coefside_t sideA, pastix_trans_t trans, const SolverCblk *cblk, const SolverBlok *blok, SolverCblk *fcblk, const void *A, const void *B, void *C, pastix_complex32_t *work, pastix_int_t lwork, const pastix_lr_t *lowrank)
Compute the updates associated to one off-diagonal block.
int cpucblk_cpotrfsp1d(SolverMatrix *solvmtx, SolverCblk *cblk, pastix_complex32_t *work, pastix_int_t lwork)
Perform the Cholesky factorization of a given panel and apply all its updates.
void cpucblk_crelease_deps(pastix_coefside_t side, SolverMatrix *solvmtx, const SolverCblk *cblk, SolverCblk *fcbk)
Release the dependencies of the given cblk after an update.
int cpucblk_cpotrfsp1d_panel(SolverMatrix *solvmtx, SolverCblk *cblk, void *L)
Compute the Cholesky factorization of one panel.
void cpucblk_ctrsmsp(pastix_side_t side, pastix_uplo_t uplo, pastix_trans_t trans, pastix_diag_t diag, const SolverCblk *cblk, const void *A, void *C, const pastix_lr_t *lowrank)
Compute the updates associated to a column of off-diagonal blocks.
void cpucblk_calloc(pastix_coefside_t side, SolverCblk *cblk)
Allocate the cblk structure to store the coefficient.
int cpucblk_cpotrfsp1d_potrf(SolverMatrix *solvmtx, SolverCblk *cblk, void *dataL)
Compute the Cholesky factorization of the diagonal block in a panel.
The block low-rank structure to hold a matrix in low-rank form.
static void * cblk_getdataL(const SolverCblk *cblk)
Get the pointer to the data associated to the lower part of the cblk.
Solver column block structure.