diff --git a/compute/pzgemm.c b/compute/pzgemm.c index 827f566e94acd14c2d6ea972fc86f656fb68de29..0c374e6450185168faf1efd732fc3c404ac86a33 100644 --- a/compute/pzgemm.c +++ b/compute/pzgemm.c @@ -291,7 +291,7 @@ chameleon_pzgemm( struct chameleon_pzgemm_s *ws, } RUNTIME_options_init( &options, chamctxt, sequence, request ); - if ( ws->summa ) + if ( ws && ws->summa ) { chameleon_pzgemm_summa( chamctxt, transA, transB, alpha, A, B, beta, C, &(ws->WA), &(ws->WB), &options ); diff --git a/control/descriptor.c b/control/descriptor.c index 5af45af7fa0ed24516a3d4835c20a385fe320de9..2a23650bb0a7e1d5be0f79765e30912c133105c1 100644 --- a/control/descriptor.c +++ b/control/descriptor.c @@ -142,6 +142,9 @@ int chameleon_getrankof_2d_diag( const CHAM_desc_t *A, int m, int n ) * ****************************************************************************** * + * @param[in] name + * Name of the descriptor for debug purpose. + * * @param[in] dtyp * Data type of the matrix: * @arg ChamRealFloat: single precision real (S), @@ -155,21 +158,12 @@ int chameleon_getrankof_2d_diag( const CHAM_desc_t *A, int m, int n ) * @param[in] nb * Number of columns in a tile. * - * @param[in] bsiz - * Size in number of elements of each tile, including internal padding. - * * @param[in] lm * Number of rows of the entire matrix. * * @param[in] ln * Number of columns of the entire matrix. * - * @param[in] i - * Row index to the beginning of the submatrix. - * - * @param[in] j - * Column indes to the beginning of the submatrix. - * * @param[in] m * Number of rows of the submatrix. * @@ -197,22 +191,19 @@ int chameleon_getrankof_2d_diag( const CHAM_desc_t *A, int m, int n ) * @return The descriptor with the matrix description parameters set. * */ -int chameleon_desc_init( CHAM_desc_t *desc, void *mat, - cham_flttype_t dtyp, int mb, int nb, int bsiz, - int lm, int ln, int i, int j, - int m, int n, int p, int q, - blkaddr_fct_t get_blkaddr, - blkldd_fct_t get_blkldd, - blkrankof_fct_t get_rankof) +int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat, + cham_flttype_t dtyp, int mb, int nb, + int lm, int ln, int m, int n, int p, int q, + blkaddr_fct_t get_blkaddr, + blkldd_fct_t get_blkldd, + blkrankof_fct_t get_rankof ) { CHAM_context_t *chamctxt; int rc = CHAMELEON_SUCCESS; memset( desc, 0, sizeof(CHAM_desc_t) ); - assert( i == 0 ); - assert( j == 0 ); - assert( bsiz == (mb * nb) ); + desc->name = name; chamctxt = chameleon_context_self(); if (chamctxt == NULL) { diff --git a/control/descriptor.h b/control/descriptor.h index 7042fe9f2cee7e9f5fb7bd2516d5d3f3a4f24e16..fc239a56964d9dbc8424351d46eae4fbc5689cb2 100644 --- a/control/descriptor.h +++ b/control/descriptor.h @@ -48,16 +48,32 @@ inline static int chameleon_getblkldd_ccrb(const CHAM_desc_t *A, int m); /** * Data distributions */ -int chameleon_getrankof_2d(const CHAM_desc_t *desc, int m, int n); -int chameleon_getrankof_2d_diag(const CHAM_desc_t *desc, int m, int n); +int chameleon_getrankof_2d(const CHAM_desc_t *desc, int m, int n); +int chameleon_getrankof_2d_diag(const CHAM_desc_t *desc, int m, int n); -int chameleon_desc_init ( CHAM_desc_t *desc, void *mat, +int chameleon_desc_init_internal( CHAM_desc_t *desc, const char *name, void *mat, + cham_flttype_t dtyp, int mb, int nb, + int lm, int ln, int m, int n, int p, int q, + void* (*get_blkaddr)( const CHAM_desc_t*, int, int ), + int (*get_blkldd) ( const CHAM_desc_t*, int ), + int (*get_rankof) ( const CHAM_desc_t*, int, int ) ); + + +static inline int chameleon_desc_init( CHAM_desc_t *desc, void *mat, cham_flttype_t dtyp, int mb, int nb, int bsiz, int lm, int ln, int i, int j, int m, int n, int p, int q, void* (*get_blkaddr)( const CHAM_desc_t*, int, int ), int (*get_blkldd) ( const CHAM_desc_t*, int ), - int (*get_rankof) ( const CHAM_desc_t*, int, int ) ); + int (*get_rankof) ( const CHAM_desc_t*, int, int ) ) +{ + assert( i == 0 ); + assert( j == 0 ); + assert( mb * nb == bsiz ); + return chameleon_desc_init_internal( desc, NULL, mat, dtyp, mb, nb, lm, ln, m, n, p, q, + get_blkaddr, get_blkldd, get_rankof ); +} + CHAM_desc_t* chameleon_desc_submatrix( CHAM_desc_t *descA, int i, int j, int m, int n ); void chameleon_desc_destroy ( CHAM_desc_t *desc ); int chameleon_desc_check ( const CHAM_desc_t *desc ); diff --git a/control/descriptor_rec.c b/control/descriptor_rec.c index 6820b46ed2495d18125eca2ab0f05239665326d8..496a4f4a0ae403ab357c012510123443eb1d3d2e 100644 --- a/control/descriptor_rec.c +++ b/control/descriptor_rec.c @@ -36,11 +36,11 @@ chameleon_recdesc_create( const char *name, CHAM_desc_t **descptr, void *mat, ch assert( (mb[0] > 0) && (nb[0] > 0) ); /* Create the current layer descriptor */ - rc = CHAMELEON_Desc_Create_User( descptr, mat, dtyp, mb[0], nb[0], mb[0] * nb[0], - lm, ln, 0, 0, m, n, 1, 1, - get_blkaddr, get_blkldd, get_rankof ); - desc = *descptr; - desc->name = name; + desc = (CHAM_desc_t*)malloc(sizeof(CHAM_desc_t)); + rc = chameleon_desc_init_internal( desc, name, mat, dtyp, mb[0], nb[0], + lm, ln, m, n, 1, 1, + get_blkaddr, get_blkldd, get_rankof ); + *descptr = desc; if ( rc != CHAMELEON_SUCCESS ) { return rc; diff --git a/coreblas/compute/global.c b/coreblas/compute/global.c index 7ce1142c0743561f725484f3cd5a91770e6243d3..e992acfd3c465589084dac5e47b36d437a90fc0c 100644 --- a/coreblas/compute/global.c +++ b/coreblas/compute/global.c @@ -57,6 +57,7 @@ void __coreblas_kernel_trace( const char *func, ... ) size += snprintf( output+size, len-size, "%s%s", first ? "" : ", ", tile->name ); + first = 0; } va_end( va_list );