From 47a66a2f5acb0f54718ea8bfd9c69e412cf66938 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Tue, 2 May 2017 18:08:31 +0200
Subject: [PATCH] Remove MAGMA from compute directory

---
 compute/pzgelqf.c        | 17 -----------------
 compute/pzgelqfrh.c      | 17 -----------------
 compute/pzgeqrf.c        | 17 -----------------
 compute/pzgeqrfrh.c      | 17 -----------------
 compute/pzgetrf_incpiv.c |  6 +-----
 compute/pzhetrd_he2hb.c  | 17 -----------------
 compute/pzpotrf.c        | 10 ----------
 compute/pzpotrimm.c      | 14 --------------
 compute/pztpqrt.c        | 15 ---------------
 9 files changed, 1 insertion(+), 129 deletions(-)

diff --git a/compute/pzgelqf.c b/compute/pzgelqf.c
index 712ded8af..36cf19e1b 100644
--- a/compute/pzgelqf.c
+++ b/compute/pzgelqf.c
@@ -86,23 +86,6 @@ void morse_pzgelqf(MORSE_desc_t *A, MORSE_desc_t *T,
     ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
 #endif
 
-#if defined(CHAMELEON_USE_MAGMA)
-    /* Worker space
-     *
-     * zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     * ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     */
-    ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
-
-    /* Host space
-     *
-     * zgelqt =     ib * A->nb + 3 * ib * ib + A->nb
-     * ztslqt = 3 * ib * A->nb +     ib * ib + A->nb
-     */
-    ws_host = chameleon_max( ws_host,     ib * A->nb + 3 * ib * ib + A->nb );
-    ws_host = chameleon_max( ws_host, 3 * ib * A->nb +     ib * ib + A->nb );
-#endif
-
     ws_worker *= sizeof(MORSE_Complex64_t);
     ws_host   *= sizeof(MORSE_Complex64_t);
 
diff --git a/compute/pzgelqfrh.c b/compute/pzgelqfrh.c
index b24b6db89..57b1d613c 100644
--- a/compute/pzgelqfrh.c
+++ b/compute/pzgelqfrh.c
@@ -87,23 +87,6 @@ void morse_pzgelqfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
     ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
 #endif
 
-#if defined(CHAMELEON_USE_MAGMA)
-    /* Worker space
-     *
-     * zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     * ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     */
-    ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
-
-    /* Host space
-     *
-     * zgelqt =     ib * A->nb + 3 * ib * ib + A->nb
-     * ztslqt = 3 * ib * A->nb +     ib * ib + A->nb
-     */
-    ws_host = chameleon_max( ws_host,     ib * A->nb + 3 * ib * ib + A->nb );
-    ws_host = chameleon_max( ws_host, 3 * ib * A->nb +     ib * ib + A->nb );
-#endif
-
     ws_worker *= sizeof(MORSE_Complex64_t);
     ws_host   *= sizeof(MORSE_Complex64_t);
 
diff --git a/compute/pzgeqrf.c b/compute/pzgeqrf.c
index a54aa8853..6e061f0ed 100644
--- a/compute/pzgeqrf.c
+++ b/compute/pzgeqrf.c
@@ -81,23 +81,6 @@ void morse_pzgeqrf(MORSE_desc_t *A, MORSE_desc_t *T,
     ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
 #endif
 
-#if defined(CHAMELEON_USE_MAGMA)
-    /* Worker space
-     *
-     * zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     * ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     */
-    ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
-
-    /* Host space
-     *
-     * zgeqrt = ib * (A->mb+3*ib) + A->mb )
-     * ztsqrt = 2 * ib * (A->nb+ib) + A->nb
-     */
-    ws_host = chameleon_max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
-    ws_host = chameleon_max( ws_host,  2 * ib * (A->nb + ib) + A->nb );
-#endif
-
     ws_worker *= sizeof(MORSE_Complex64_t);
     ws_host   *= sizeof(MORSE_Complex64_t);
 
diff --git a/compute/pzgeqrfrh.c b/compute/pzgeqrfrh.c
index a5e828c8b..c5b026358 100644
--- a/compute/pzgeqrfrh.c
+++ b/compute/pzgeqrfrh.c
@@ -85,23 +85,6 @@ void morse_pzgeqrfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
     ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
 #endif
 
-#if defined(CHAMELEON_USE_MAGMA)
-    /* Worker space
-     *
-     * zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     * ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     */
-    ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
-
-    /* Host space
-     *
-     * zgeqrt = ib * (A->nb+3*ib) + A->nb )
-     * ztsqrt = 2 * ib * (A->nb+ib) + A->nb
-     */
-    ws_host = chameleon_max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
-    ws_host = chameleon_max( ws_host,  2 * ib * (A->nb + ib) + A->nb );
-#endif
-
     ws_worker *= sizeof(MORSE_Complex64_t);
     ws_host   *= sizeof(MORSE_Complex64_t);
 
diff --git a/compute/pzgetrf_incpiv.c b/compute/pzgetrf_incpiv.c
index f960873e6..5da79407c 100644
--- a/compute/pzgetrf_incpiv.c
+++ b/compute/pzgetrf_incpiv.c
@@ -64,13 +64,9 @@ void morse_pzgetrf_incpiv(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV,
     RUNTIME_options_init(&options, morse, sequence, request);
 
     ib = MORSE_IB;
-#if defined(CHAMELEON_USE_MAGMA)
-    h_work_size  = sizeof(MORSE_Complex64_t)*( 2*ib + 2*L->nb )*2*A->mb;
-    d_work_size  = sizeof(MORSE_Complex64_t)*(   ib           )*2*A->mb;
-#else
     h_work_size  = sizeof(MORSE_Complex64_t)*( ib*L->nb );
     d_work_size  = 0;
-#endif
+
     RUNTIME_options_ws_alloc( &options, h_work_size, d_work_size );
 
     /* necessary to avoid dependencies between tasks regarding the diag tile */
diff --git a/compute/pzhetrd_he2hb.c b/compute/pzhetrd_he2hb.c
index 497b574d4..2173faa09 100644
--- a/compute/pzhetrd_he2hb.c
+++ b/compute/pzhetrd_he2hb.c
@@ -85,23 +85,6 @@ void morse_pzhetrd_he2hb(MORSE_enum uplo,
     ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
 #endif
 
-#if defined(CHAMELEON_USE_MAGMA)
-    /* Worker space
-     *
-     * zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     * ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     */
-    ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
-
-    /* Host space
-     *
-     * zgeqrt = ib * (A->mb+3*ib) + A->mb )
-     * ztsqrt = 2 * ib * (A->nb+ib) + A->nb
-     */
-    ws_host = chameleon_max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
-    ws_host = chameleon_max( ws_host,  2 * ib * (A->nb + ib) + A->nb );
-#endif
-
     ws_worker *= sizeof(MORSE_Complex64_t);
     ws_host   *= sizeof(MORSE_Complex64_t);
 
diff --git a/compute/pzpotrf.c b/compute/pzpotrf.c
index 44b7d25f5..bc648c74c 100644
--- a/compute/pzpotrf.c
+++ b/compute/pzpotrf.c
@@ -54,16 +54,6 @@ void morse_pzpotrf(MORSE_enum uplo, MORSE_desc_t *A,
         return;
     RUNTIME_options_init(&options, morse, sequence, request);
 
-#ifdef CHAMELEON_USE_MAGMA
-    if (0) /* Disable the workspace as long as it is is not used (See StarPU codelet) */
-    {
-        int nb = MORSE_IB; /* Approximate nb for simulation */
-#if !defined(CHAMELEON_SIMULATION)
-        nb = magma_get_zpotrf_nb(A->nb);
-#endif
-        ws_host = sizeof(MORSE_Complex64_t)*nb*nb;
-    }
-#endif
     RUNTIME_options_ws_alloc( &options, 0, ws_host );
 
     /*
diff --git a/compute/pzpotrimm.c b/compute/pzpotrimm.c
index d1b7323c1..a9d779b30 100644
--- a/compute/pzpotrimm.c
+++ b/compute/pzpotrimm.c
@@ -57,17 +57,6 @@ void morse_pzpotrimm(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_de
         return;
     RUNTIME_options_init(&options, morse, sequence, request);
 
-#ifdef CHAMELEON_USE_MAGMA
-    {
-#if !defined(CHAMELEON_SIMULATION)
-        int nb = magma_get_zpotrf_nb(A->nb);
-#else
-        int nb = A->nb;
-#endif
-        RUNTIME_options_ws_alloc( &options, nb*nb, 0 );
-    }
-#endif
-
     /*
      *  MorseLower
      */
@@ -489,8 +478,5 @@ void morse_pzpotrimm(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_de
         }
     }
 
-#ifdef CHAMELEON_USE_MAGMA
-    RUNTIME_options_ws_free(&options);
-#endif
     RUNTIME_options_finalize(&options, morse);
 }
diff --git a/compute/pztpqrt.c b/compute/pztpqrt.c
index 1807857a2..d20512803 100644
--- a/compute/pztpqrt.c
+++ b/compute/pztpqrt.c
@@ -70,21 +70,6 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
     ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
 #endif
 
-#if defined(CHAMELEON_USE_MAGMA)
-    /* Worker space
-     *
-     * ztpqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
-     */
-    ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
-
-    /* Host space
-     *
-     * ztpqrt = 2 * ib * (A->nb+ib) + A->nb
-     */
-    ws_host = chameleon_max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
-    ws_host = chameleon_max( ws_host,  2 * ib * (A->nb + ib) + A->nb );
-#endif
-
     ws_worker *= sizeof(MORSE_Complex64_t);
     ws_host   *= sizeof(MORSE_Complex64_t);
 
-- 
GitLab