Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1b50f2e9 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

coreblas: Add print function

parent efa10536
No related branches found
No related tags found
1 merge request!367Add a debug function to print the matrix tile by tile into a file
...@@ -43,6 +43,7 @@ _extra_blas = [ ...@@ -43,6 +43,7 @@ _extra_blas = [
('', 'scesca', 'dcesca', 'ccesca', 'zcesca' ), ('', 'scesca', 'dcesca', 'ccesca', 'zcesca' ),
('', 'sgesum', 'dgesum', 'cgesum', 'zgesum' ), ('', 'sgesum', 'dgesum', 'cgesum', 'zgesum' ),
('', 'sgersum', 'dgersum', 'cgersum', 'zgersum' ), ('', 'sgersum', 'dgersum', 'cgersum', 'zgersum' ),
('', 'sprint', 'dprint', 'cprint', 'zprint' ),
] ]
_extra_BLAS = [ [ x.upper() for x in row ] for row in _extra_blas ] _extra_BLAS = [ [ x.upper() for x in row ] for row in _extra_blas ]
......
...@@ -107,6 +107,7 @@ set(ZSRC ...@@ -107,6 +107,7 @@ set(ZSRC
core_zttqrt.c core_zttqrt.c
core_zunmlq.c core_zunmlq.c
core_zunmqr.c core_zunmqr.c
core_zprint.c
) )
if( CHAMELEON_USE_HMAT ) if( CHAMELEON_USE_HMAT )
list( APPEND ZSRC list( APPEND ZSRC
......
/**
*
* @file core_zprint.c
*
* @copyright 2012-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
*
* @brief Chameleon core_zprint CPU kernel
*
* @version 1.0.0
* @author Mathieu Faverge
* @date 2020-03-03
* @precisions normal z -> c d s
*
*/
#include "coreblas/lapacke.h"
#include "coreblas.h"
void
CORE_zprint( FILE *file, const char *header,
cham_uplo_t uplo, int M, int N, int Am, int An,
const CHAMELEON_Complex64_t *A, int lda )
{
FILE *output = (file == NULL) ? stdout : file;
int i, j;
fflush( output );
fprintf( output, "--- %10s (%2d, %2d) / %p, %d:\n", header, Am, An, A, lda );
for(i=0; i<M; i++) {
fprintf( output, " " );
for(j=0; j<N; j++) {
#if defined(PRECISION_z) || defined(PRECISION_c)
fprintf( output, " (% e, % e)",
creal( A[j*lda + i] ),
cimag( A[j*lda + i] ));
#else
fprintf( output, " % e", A[j*lda + i] );
#endif
}
fprintf( output, "\n" );
}
fprintf( output, "-------------------------\n" );
fflush( output );
}
...@@ -1072,3 +1072,13 @@ TCORE_zgram( cham_uplo_t uplo, ...@@ -1072,3 +1072,13 @@ TCORE_zgram( cham_uplo_t uplo,
return CORE_zgram( return CORE_zgram(
uplo, M, N, Mt, Nt, CHAM_tile_get_ptr( Di ), Di->ld, CHAM_tile_get_ptr( Dj ), Dj->ld, CHAM_tile_get_ptr( D ), CHAM_tile_get_ptr( A ), A->ld ); uplo, M, N, Mt, Nt, CHAM_tile_get_ptr( Di ), Di->ld, CHAM_tile_get_ptr( Dj ), Dj->ld, CHAM_tile_get_ptr( D ), CHAM_tile_get_ptr( A ), A->ld );
} }
void
TCORE_zprint( FILE *file, const char *header,
cham_uplo_t uplo, int M, int N,
int Am, int An, const CHAM_tile_t *A )
{
coreblas_kernel_trace( A );
assert( A->format & CHAMELEON_TILE_FULLRANK );
CORE_zprint( file, header, uplo, M, N, Am, An, CHAM_tile_get_ptr( A ), A->ld );
}
...@@ -393,4 +393,8 @@ int CORE_zgram( cham_uplo_t uplo, int M, int N, int Mt, int Nt, ...@@ -393,4 +393,8 @@ int CORE_zgram( cham_uplo_t uplo, int M, int N, int Mt, int Nt,
const double *D, const double *D,
double *A, int LDA ); double *A, int LDA );
void CORE_zprint( FILE *file, const char *header,
cham_uplo_t uplo, int m, int n, int Am, int An,
const CHAMELEON_Complex64_t *A, int lda );
#endif /* _coreblas_z_h_ */ #endif /* _coreblas_z_h_ */
...@@ -86,5 +86,6 @@ int TCORE_zunmqr( cham_side_t side, cham_trans_t trans, int M, int N, int K, in ...@@ -86,5 +86,6 @@ int TCORE_zunmqr( cham_side_t side, cham_trans_t trans, int M, int N, int K, in
int TCORE_zgesum( cham_store_t storev, int M, int N, const CHAM_tile_t *A, CHAM_tile_t *sum ); int TCORE_zgesum( cham_store_t storev, int M, int N, const CHAM_tile_t *A, CHAM_tile_t *sum );
int TCORE_zcesca( int center, int scale, cham_store_t axis, int M, int N, int Mt, int Nt, const CHAM_tile_t *Gi, const CHAM_tile_t *Gj, const CHAM_tile_t *G, const CHAM_tile_t *Di, const CHAM_tile_t *Dj, CHAM_tile_t *A ); int TCORE_zcesca( int center, int scale, cham_store_t axis, int M, int N, int Mt, int Nt, const CHAM_tile_t *Gi, const CHAM_tile_t *Gj, const CHAM_tile_t *G, const CHAM_tile_t *Di, const CHAM_tile_t *Dj, CHAM_tile_t *A );
int TCORE_zgram( cham_uplo_t uplo, int M, int N, int Mt, int Nt, const CHAM_tile_t *Di, const CHAM_tile_t *Dj, const CHAM_tile_t *D, CHAM_tile_t *A ); int TCORE_zgram( cham_uplo_t uplo, int M, int N, int Mt, int Nt, const CHAM_tile_t *Di, const CHAM_tile_t *Dj, const CHAM_tile_t *D, CHAM_tile_t *A );
void TCORE_zprint( FILE *file, const char *header, cham_uplo_t uplo, int M, int N, int Am, int An, const CHAM_tile_t *A );
#endif /* _coreblas_ztile_h_ */ #endif /* _coreblas_ztile_h_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment