diff --git a/compute/CMakeLists.txt b/compute/CMakeLists.txt index cc25fb7d233c7206ced2d9e5fc59766e1bef25fe..3d6a7caf4dedb592cd1aa8422212bd091c287687 100644 --- a/compute/CMakeLists.txt +++ b/compute/CMakeLists.txt @@ -40,11 +40,12 @@ set(CHAMELEON_CONTROL ../control/context.c ../control/control.c ../control/descriptor.c - ../control/descriptor_rec.c ../control/descriptor_helpers.c ../control/descriptor_ipiv.c - ../control/workspace.c + ../control/descriptor_rec.c + ../control/lamch.c ../control/tile.c + ../control/workspace.c ../control/chameleon_f77.c ../control/chameleon_mf77.c map.c diff --git a/control/lamch.c b/control/lamch.c new file mode 100644 index 0000000000000000000000000000000000000000..7dccb23f07fd4db5ef46b5ddcb971c2ae9d03a33 --- /dev/null +++ b/control/lamch.c @@ -0,0 +1,56 @@ +/** + * + * @file lamch.c + * + * @copyright 2024-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, + * Univ. Bordeaux. All rights reserved. + * + *** + * + * @brief Chameleon lamch wrapper to factorize the test with simulation compilations + * + * @version 1.3.0 + * @author Mathieu Faverge + * @date 2024-09-18 + * + */ +#include "control/common.h" +#if !defined(CHAMELEON_SIMULATION) +#include "coreblas/lapacke.h" +#endif + +/** + * + * Wrapper to the LAPACKE_slamch_work('e') call that returns a pre-defined value + * if compile with SimGrid. + * + * @return The epsilon value for single precision + * + */ +float +CHAMELEON_slamch( void ) +{ +#if !defined(CHAMELEON_SIMULATION) + return LAPACKE_slamch_work( 'e' ); +#else + return 1.e-7; +#endif +} + +/** + * + * Wrapper to the LAPACKE_dlamch_work('e') call that returns a pre-defined value + * if compile with SimGrid. + * + * @return The epsilon value for single precision + * + */ +double +CHAMELEON_dlamch( void ) +{ +#if !defined(CHAMELEON_SIMULATION) + return LAPACKE_dlamch_work( 'e' ); +#else + return 1.e-15; +#endif +} diff --git a/include/chameleon.h b/include/chameleon.h index 7aeaf7d331227c35cd34288db6a95b68fc50f2fc..cb7e23dedaf7330ab0deffef714f6d9bc01fb7b1 100644 --- a/include/chameleon.h +++ b/include/chameleon.h @@ -227,6 +227,10 @@ int CHAMELEON_Ipiv_Gather( CHAM_ipiv_t *ipivdesc, int root ); void CHAMELEON_Ipiv_Print ( const CHAM_ipiv_t *ipiv ); +/* Numerical helpers */ +float CHAMELEON_slamch( void ); +double CHAMELEON_dlamch( void ); + /** * * @ingroup Control