From 3cb7d7a2b48eee8187b490103773bc38d697524e Mon Sep 17 00:00:00 2001 From: Mathieu Faverge <mathieu.faverge@inria.fr> Date: Thu, 4 Apr 2024 17:07:41 +0200 Subject: [PATCH] context: Add a function to return the chameleon context in order to be able to use the public runtime API --- control/context.c | 24 ++++++++++++++++++++++++ include/chameleon.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/control/context.c b/control/context.c index 566b5461b..cfbe13a71 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 854400342..f1d335495 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"))); -- GitLab