diff --git a/control/context.c b/control/context.c index 566b5461ba10d68ca1d799515f96c61b7fb529ab..cfbe13a714ec97d1f817aaff6e4762e7e85b7ef4 100644 --- a/control/context.c +++ b/control/context.c @@ -483,3 +483,27 @@ int CHAMELEON_Get( int param, int *value ) return CHAMELEON_SUCCESS; } + +/** + * + * @ingroup Options + * + * CHAMELEON_GetContext - Get the Chameleon context pointer + * + ******************************************************************************* + * + * @retval NULL if not initialized + * @retval The pointer to the initialized Chameleon context + * + */ +CHAM_context_t *CHAMELEON_GetContext() +{ + CHAM_context_t *chamctxt; + + chamctxt = chameleon_context_self(); + if (chamctxt == NULL) { + chameleon_error("CHAMELEON_Get", "CHAMELEON not initialized"); + return NULL; + } + return chamctxt; +} diff --git a/include/chameleon.h b/include/chameleon.h index 854400342bca932ea5c2f3318ffbb0a60e1bd051..f1d33549595e475ee4bf60514bd08689d5416b40 100644 --- a/include/chameleon.h +++ b/include/chameleon.h @@ -134,6 +134,8 @@ int CHAMELEON_Distributed_size (int *size); int CHAMELEON_Distributed_rank (int *rank); int CHAMELEON_GetThreadNbr (void); +CHAM_context_t *CHAMELEON_GetContext(); + int CHAMELEON_Lapack_to_Tile( void *Af77, int LDA, CHAM_desc_t *A ) __attribute__((deprecated("Please refer to CHAMELEON_Lap2Desc() instead"))); int CHAMELEON_Tile_to_Lapack( CHAM_desc_t *A, void *Af77, int LDA ) __attribute__((deprecated("Please refer to CHAMELEON_Desc2Lap() instead")));