From 5ba6000eec41ee5229fe233e0088e747b0decda7 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Fri, 2 Dec 2016 12:25:24 +0000
Subject: [PATCH] prevent from using magma if in simu mode

---
 compute/pzpotrf.c   | 5 ++++-
 compute/pzpotrimm.c | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/compute/pzpotrf.c b/compute/pzpotrf.c
index 152422a5b..45a78b910 100644
--- a/compute/pzpotrf.c
+++ b/compute/pzpotrf.c
@@ -3,7 +3,7 @@
  * @copyright (c) 2009-2014 The University of Tennessee and The University
  *                          of Tennessee Research Foundation.
  *                          All rights reserved.
- * @copyright (c) 2012-2014 Inria. All rights reserved.
+ * @copyright (c) 2012-2016 Inria. All rights reserved.
  * @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
  *
  **/
@@ -24,6 +24,7 @@
  * @author Mathieu Faverge
  * @author Emmanuel Agullo
  * @author Cedric Castagnede
+ * @author Florent Pruvost
  * @date 2010-11-15
  * @precisions normal z -> s d c
  *
@@ -56,7 +57,9 @@ void morse_pzpotrf(MORSE_enum uplo, MORSE_desc_t *A,
 #ifdef CHAMELEON_USE_MAGMA
     if (0) /* Disable the workspace as long as it is is not used*/
     {
+#if !defined(CHAMELEON_SIMULATION)
         int nb = magma_get_zpotrf_nb(A->nb);
+#endif
         ws_host = sizeof(MORSE_Complex64_t)*nb*nb;
     }
 #endif
diff --git a/compute/pzpotrimm.c b/compute/pzpotrimm.c
index 8f7345db6..db4c65787 100644
--- a/compute/pzpotrimm.c
+++ b/compute/pzpotrimm.c
@@ -3,7 +3,7 @@
  * @copyright (c) 2009-2014 The University of Tennessee and The University
  *                          of Tennessee Research Foundation.
  *                          All rights reserved.
- * @copyright (c) 2012-2014 Inria. All rights reserved.
+ * @copyright (c) 2012-2016 Inria. All rights reserved.
  * @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
  *
  **/
@@ -59,7 +59,9 @@ void morse_pzpotrimm(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_de
 
 #ifdef CHAMELEON_USE_MAGMA
     {
+#if !defined(CHAMELEON_SIMULATION)
       int nb = magma_get_zpotrf_nb(A->nb);
+#endif
       RUNTIME_options_ws_alloc( &options, nb*nb, 0 );
     }
 #endif
-- 
GitLab