23 #ifndef DOXYGEN_SHOULD_SKIP_THIS
24 static pastix_complex64_t zone = 1.0;
25 static pastix_complex64_t zzero = 0.0;
51 pastix_complex64_t *Cptr;
59 Cptr += ldcu * offy + offx;
61 pastix_atomic_lock( lock );
62 assert( C->rk == -1 );
67 cblas_zgemm( CblasColMajor, (CBLAS_TRANSPOSE)transA, (CBLAS_TRANSPOSE)transB,
69 CBLAS_SADDR(alpha), A->u, ldau,
71 CBLAS_SADDR(beta), Cptr, ldcu );
72 flops = FLOPS_ZGEMM( M, N, K );
74 pastix_atomic_unlock( lock );
104 pastix_complex64_t *Cptr;
106 pastix_fixdbl_t flops1 = FLOPS_ZGEMM( M, B->rk, K ) + FLOPS_ZGEMM( M, N, B->rk );
107 pastix_fixdbl_t flops2 = FLOPS_ZGEMM( K, N, B->rk ) + FLOPS_ZGEMM( M, N, K );
113 ldbv = ( B->rk == -1 ) ? -1 : B->rkmax;
117 Cptr += ldcu * offy + offx;
122 if ( flops1 <= flops2 ) {
124 work = malloc( M * B->rk *
sizeof(pastix_complex64_t) );
131 cblas_zgemm( CblasColMajor, (CBLAS_TRANSPOSE)transA, (CBLAS_TRANSPOSE)transB,
133 CBLAS_SADDR(zone), A->u, ldau,
135 CBLAS_SADDR(zzero), work, M );
137 pastix_atomic_lock( lock );
138 assert( C->rk == -1 );
139 cblas_zgemm( CblasColMajor, CblasNoTrans, (CBLAS_TRANSPOSE)transB,
141 CBLAS_SADDR(alpha), work, M,
143 CBLAS_SADDR(beta), Cptr, ldcu );
145 pastix_atomic_unlock( lock );
149 work = malloc( K * N *
sizeof(pastix_complex64_t) );
156 cblas_zgemm( CblasColMajor, CblasNoTrans, CblasNoTrans,
158 CBLAS_SADDR(zone), B->u, ldbu,
160 CBLAS_SADDR(zzero), work, K );
162 pastix_atomic_lock( lock );
163 assert( C->rk == -1 );
164 cblas_zgemm( CblasColMajor, (CBLAS_TRANSPOSE)transA, (CBLAS_TRANSPOSE)transB,
166 CBLAS_SADDR(alpha), A->u, ldau,
168 CBLAS_SADDR(beta), Cptr, ldcu );
171 pastix_atomic_unlock( lock );
205 pastix_complex64_t *Cptr;
207 pastix_fixdbl_t flops1 = FLOPS_ZGEMM( A->rk, N, K ) + FLOPS_ZGEMM( M, N, A->rk );
208 pastix_fixdbl_t flops2 = FLOPS_ZGEMM( M, K, A->rk ) + FLOPS_ZGEMM( M, N, K );
213 ldav = ( A->rk == -1 ) ? -1 : A->rkmax;
218 Cptr += ldcu * offy + offx;
223 if ( flops1 <= flops2 ) {
225 work = malloc( A->rk * N *
sizeof(pastix_complex64_t) );
232 cblas_zgemm( CblasColMajor, CblasNoTrans, (CBLAS_TRANSPOSE)transB,
234 CBLAS_SADDR(zone), A->v, ldav,
236 CBLAS_SADDR(zzero), work, A->rk );
238 pastix_atomic_lock( lock );
239 assert( C->rk == -1 );
240 cblas_zgemm( CblasColMajor, CblasNoTrans, CblasNoTrans,
242 CBLAS_SADDR(alpha), A->u, ldau,
244 CBLAS_SADDR(beta), Cptr, ldcu );
247 pastix_atomic_unlock( lock );
251 work = malloc( M * K *
sizeof(pastix_complex64_t) );
258 cblas_zgemm( CblasColMajor, CblasNoTrans, CblasNoTrans,
260 CBLAS_SADDR(zone), A->u, ldau,
262 CBLAS_SADDR(zzero), work, M );
264 pastix_atomic_lock( lock );
265 assert( C->rk == -1 );
266 cblas_zgemm( CblasColMajor, (CBLAS_TRANSPOSE)transA, (CBLAS_TRANSPOSE)transB,
268 CBLAS_SADDR(alpha), work, M,
270 CBLAS_SADDR(beta), Cptr, ldcu );
273 pastix_atomic_unlock( lock );
307 pastix_complex64_t *Cptr;
316 Cptr += ldcu * offy + offx;
319 assert( AB.
rk != -1 );
320 assert( AB.
rkmax != -1 );
329 pastix_atomic_lock( lock );
330 assert( C->rk == -1 );
332 cblas_zgemm( CblasColMajor, CblasNoTrans, (CBLAS_TRANSPOSE)trans,
334 CBLAS_SADDR(alpha), AB.
u, M,
336 CBLAS_SADDR(beta), Cptr, ldcu );
337 flops = FLOPS_ZGEMM( M, N, AB.
rk );
338 pastix_atomic_unlock( lock );
BEGIN_C_DECLS typedef int pastix_int_t
#define PASTE_CORE_ZLRMM_PARAMS(_a_)
Initialize all the parameters of the core_zlrmm family functions to ease the access.
static pastix_complex64_t * core_zlrmm_getws(core_zlrmm_t *params, ssize_t newsize)
Function to get a workspace pointer if space is available in the one provided.
pastix_fixdbl_t core_zfrlr2fr(core_zlrmm_t *params)
Perform the operation C = alpha * op(A) * op(B) + beta C, with A and C full-rank and B low-rank.
pastix_fixdbl_t core_zlrlr2fr(core_zlrmm_t *params)
Perform the operation C = alpha * op(A) * op(B) + beta C, with A and B low-rank and C full-rank.
#define PASTE_CORE_ZLRMM_VOID
Void all the parameters of the core_zlrmm family functions to silent warnings.
pastix_fixdbl_t core_zfrfr2fr(core_zlrmm_t *params)
Perform the full-rank operation C = alpha * op(A) * op(B) + beta C.
pastix_fixdbl_t core_zlrfr2fr(core_zlrmm_t *params)
Perform the operation C = alpha * op(A) * op(B) + beta C, with B and C full-rank and A low-rank.
pastix_fixdbl_t core_zlrlr2lr(core_zlrmm_t *params, pastix_lrblock_t *AB, int *infomask)
Perform the operation AB = op(A) * op(B), with A, B, and AB low-rank.
Structure to store all the parameters of the core_zlrmm family functions.
#define PASTIX_LRM3_ALLOCV
Macro to specify if the V part of a low-rank matrix has been allocated and need to be freed or not (U...
#define PASTIX_LRM3_TRANSB
Macro to specify if the the operator on B, still needs to be applied to the V part of the low-rank ma...
#define PASTIX_LRM3_ALLOCU
Macro to specify if the U part of a low-rank matrix has been allocated and need to be freed or not (U...
The block low-rank structure to hold a matrix in low-rank form.
enum pastix_trans_e pastix_trans_t
Transpostion.