From 70fc142c197454b441c30c0397f3d666375cce40 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Mon, 22 May 2023 23:48:07 -0400
Subject: [PATCH] testing/parameter: Make sure we don't use mixed precision
 with global and out-of-core matrices allocations

---
 testing/parameters.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/testing/parameters.c b/testing/parameters.c
index 5beb021c6..9607d83e9 100644
--- a/testing/parameters.c
+++ b/testing/parameters.c
@@ -13,6 +13,7 @@
  * @author Mathieu Faverge
  * @author Alycia Lisito
  * @author Lionel Eyraud-Dubois
+ * @author Lucas Barros De Assis
  * @date 2023-07-05
  *
  */
@@ -489,6 +490,12 @@ parameters_desc_create( const char *id, CHAM_desc_t **descptr, cham_flttype_t dt
 
     mtxfmt = -mtxfmt; /* Inverse sign to get the defined values */
 
+    if ( cham_is_mixed( dtyp )  && ( (void*)mtxfmt != CHAMELEON_MAT_ALLOC_TILE ) )
+    {
+        fprintf( stderr, "parameters_desc_create: Mixed precision descriptors can only be used with tiled allocation. Please enforce '--mtxfmt=1' \n" );
+        return CHAMELEON_ERR_ILLEGAL_VALUE;
+    }
+
     if ( !custom ) {
         int P = parameters_getvalue_int( "P" );
         int Q = parameters_compute_q( P );
-- 
GitLab