From 2e728b00962b81abbe6501e1d98315d03b5a2586 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Thu, 25 Jan 2018 18:51:04 +0100
Subject: [PATCH] Add missing flush in QR functions

---
 compute/pzgeqrfrh.c     | 4 ++--
 compute/zgelqf.c        | 1 +
 compute/zgelqf_param.c  | 2 ++
 compute/zgelqs.c        | 1 +
 compute/zgelqs_param.c  | 2 ++
 compute/zgels.c         | 1 +
 compute/zgels_param.c   | 2 ++
 compute/zgeqrf.c        | 1 +
 compute/zgeqrf_param.c  | 2 ++
 compute/zgeqrs.c        | 1 +
 compute/zgeqrs_param.c  | 2 ++
 compute/zgesv_incpiv.c  | 1 +
 compute/zgetrf_incpiv.c | 1 +
 compute/zgetrs_incpiv.c | 1 +
 compute/ztpgqrt.c       | 2 ++
 compute/ztpqrt.c        | 1 +
 compute/zunglq.c        | 1 +
 compute/zunglq_param.c  | 2 ++
 compute/zungqr.c        | 1 +
 compute/zungqr_param.c  | 2 ++
 compute/zunmlq.c        | 1 +
 compute/zunmlq_param.c  | 2 ++
 compute/zunmqr.c        | 1 +
 compute/zunmqr_param.c  | 2 ++
 24 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/compute/pzgeqrfrh.c b/compute/pzgeqrfrh.c
index a2ea808b9..30d6a1273 100644
--- a/compute/pzgeqrfrh.c
+++ b/compute/pzgeqrfrh.c
@@ -31,8 +31,8 @@
  **/
 #include "control/common.h"
 
-#define A(m,n) A,  (m),  (n)
-#define T(m,n) T,  (m),  (n)
+#define A(m,n)  A,  (m),  (n)
+#define T(m,n)  T,  (m),  (n)
 #define T2(m,n) T,  (m), ((n)+A->nt)
 #if defined(CHAMELEON_COPY_DIAG)
 #define D(m,n) D, ((m)/BS), 0
diff --git a/compute/zgelqf.c b/compute/zgelqf.c
index bcab0855f..3e9529bec 100644
--- a/compute/zgelqf.c
+++ b/compute/zgelqf.c
@@ -132,6 +132,7 @@ int MORSE_zgelqf( int M, int N,
     /* Submit the matrix conversion back */
     morse_ztile2lap( morse, &descAl, &descAt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgelqf_param.c b/compute/zgelqf_param.c
index fe0623cb7..76e11f6b9 100644
--- a/compute/zgelqf_param.c
+++ b/compute/zgelqf_param.c
@@ -129,6 +129,8 @@ int MORSE_zgelqf_param( const libhqr_tree_t *qrtree, int M, int N,
     /* Submit the matrix conversion back */
     morse_ztile2lap( morse, &descAl, &descAt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgelqs.c b/compute/zgelqs.c
index ccf896144..75bf9db2d 100644
--- a/compute/zgelqs.c
+++ b/compute/zgelqs.c
@@ -152,6 +152,7 @@ int MORSE_zgelqs( int M, int N, int NRHS,
                      MorseDescInput, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgelqs_param.c b/compute/zgelqs_param.c
index ffac93d2e..6171fd70c 100644
--- a/compute/zgelqs_param.c
+++ b/compute/zgelqs_param.c
@@ -154,6 +154,8 @@ int MORSE_zgelqs_param( const libhqr_tree_t *qrtree, int M, int N, int NRHS,
                      MorseDescInput, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgels.c b/compute/zgels.c
index 74d65ca46..22af1ab71 100644
--- a/compute/zgels.c
+++ b/compute/zgels.c
@@ -194,6 +194,7 @@ int MORSE_zgels( MORSE_enum trans, int M, int N, int NRHS,
                      MorseDescInout, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgels_param.c b/compute/zgels_param.c
index 5619b004a..d965a0898 100644
--- a/compute/zgels_param.c
+++ b/compute/zgels_param.c
@@ -195,6 +195,8 @@ int MORSE_zgels_param( const libhqr_tree_t *qrtree, MORSE_enum trans, int M, int
                      MorseDescInout, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgeqrf.c b/compute/zgeqrf.c
index 6695351de..e58694721 100644
--- a/compute/zgeqrf.c
+++ b/compute/zgeqrf.c
@@ -131,6 +131,7 @@ int MORSE_zgeqrf( int M, int N,
     /* Submit the matrix conversion back */
     morse_ztile2lap( morse, &descAl, &descAt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgeqrf_param.c b/compute/zgeqrf_param.c
index 5e5b220f0..0586e4630 100644
--- a/compute/zgeqrf_param.c
+++ b/compute/zgeqrf_param.c
@@ -134,6 +134,8 @@ int MORSE_zgeqrf_param( const libhqr_tree_t *qrtree, int M, int N,
     /* Submit the matrix conversion back */
     morse_ztile2lap( morse, &descAl, &descAt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgeqrs.c b/compute/zgeqrs.c
index d8de43c6e..db7fb9e7b 100644
--- a/compute/zgeqrs.c
+++ b/compute/zgeqrs.c
@@ -152,6 +152,7 @@ int MORSE_zgeqrs( int M, int N, int NRHS,
                      MorseDescInput, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgeqrs_param.c b/compute/zgeqrs_param.c
index cd7f17b6b..26d98eb28 100644
--- a/compute/zgeqrs_param.c
+++ b/compute/zgeqrs_param.c
@@ -147,6 +147,8 @@ int MORSE_zgeqrs_param( const libhqr_tree_t *qrtree, int M, int N, int NRHS,
                      MorseDescInput, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgesv_incpiv.c b/compute/zgesv_incpiv.c
index 9808488cc..a3e9c8c3e 100644
--- a/compute/zgesv_incpiv.c
+++ b/compute/zgesv_incpiv.c
@@ -151,6 +151,7 @@ int MORSE_zgesv_incpiv( int N, int NRHS,
                      MorseDescInout, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descL, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgetrf_incpiv.c b/compute/zgetrf_incpiv.c
index 63ead5685..8c1c9eddf 100644
--- a/compute/zgetrf_incpiv.c
+++ b/compute/zgetrf_incpiv.c
@@ -133,6 +133,7 @@ int MORSE_zgetrf_incpiv( int M, int N,
     /* Submit the matrix conversion back */
     morse_ztile2lap( morse, &descAl, &descAt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descL, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zgetrs_incpiv.c b/compute/zgetrs_incpiv.c
index f877c8aa3..e22d55f2e 100644
--- a/compute/zgetrs_incpiv.c
+++ b/compute/zgetrs_incpiv.c
@@ -157,6 +157,7 @@ int MORSE_zgetrs_incpiv( MORSE_enum trans, int N, int NRHS,
                      MorseDescInput, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descL, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/ztpgqrt.c b/compute/ztpgqrt.c
index d28a53099..7763b4136 100644
--- a/compute/ztpgqrt.c
+++ b/compute/ztpgqrt.c
@@ -232,6 +232,8 @@ int MORSE_ztpgqrt( int M, int N, int K, int L,
                      MorseDescInout, MorseUpperLower, sequence, &request );
     morse_ztile2lap( morse, &descQ2l, &descQ2t,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT1, sequence );
+    MORSE_Desc_Flush( descT2, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/ztpqrt.c b/compute/ztpqrt.c
index 9f5f60bbf..af70716d9 100644
--- a/compute/ztpqrt.c
+++ b/compute/ztpqrt.c
@@ -200,6 +200,7 @@ int MORSE_ztpqrt( int M, int N, int L,
                      MorseDescInout, MorseUpper, sequence, &request );
     morse_ztile2lap( morse, &descBl, &descBt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zunglq.c b/compute/zunglq.c
index f8738d768..ca9ed653b 100644
--- a/compute/zunglq.c
+++ b/compute/zunglq.c
@@ -151,6 +151,7 @@ int MORSE_zunglq( int M, int N, int K,
                      MorseDescInput, MorseUpper, sequence, &request );
     morse_ztile2lap( morse, &descQl, &descQt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zunglq_param.c b/compute/zunglq_param.c
index 45110d3f7..39f63a41e 100644
--- a/compute/zunglq_param.c
+++ b/compute/zunglq_param.c
@@ -148,6 +148,8 @@ int MORSE_zunglq_param( const libhqr_tree_t *qrtree, int M, int N, int K,
                      MorseDescInput, MorseUpper, sequence, &request );
     morse_ztile2lap( morse, &descQl, &descQt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zungqr.c b/compute/zungqr.c
index 954f2da51..331a5b352 100644
--- a/compute/zungqr.c
+++ b/compute/zungqr.c
@@ -150,6 +150,7 @@ int MORSE_zungqr( int M, int N, int K,
                      MorseDescInput, MorseLower, sequence, &request );
     morse_ztile2lap( morse, &descQl, &descQt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zungqr_param.c b/compute/zungqr_param.c
index 8621b7816..1f70aad41 100644
--- a/compute/zungqr_param.c
+++ b/compute/zungqr_param.c
@@ -149,6 +149,8 @@ int MORSE_zungqr_param( const libhqr_tree_t *qrtree,
                      MorseDescInput, MorseLower, sequence, &request );
     morse_ztile2lap( morse, &descQl, &descQt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zunmlq.c b/compute/zunmlq.c
index 5901868c4..33e73eb18 100644
--- a/compute/zunmlq.c
+++ b/compute/zunmlq.c
@@ -188,6 +188,7 @@ int MORSE_zunmlq( MORSE_enum side, MORSE_enum trans, int M, int N, int K,
                      MorseDescInput, MorseUpper, sequence, &request );
     morse_ztile2lap( morse, &descCl, &descCt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zunmlq_param.c b/compute/zunmlq_param.c
index 4a6375136..7b46fbb86 100644
--- a/compute/zunmlq_param.c
+++ b/compute/zunmlq_param.c
@@ -187,6 +187,8 @@ int MORSE_zunmlq_param( const libhqr_tree_t *qrtree, MORSE_enum side, MORSE_enum
                      MorseDescInput, MorseUpper, sequence, &request );
     morse_ztile2lap( morse, &descCl, &descCt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zunmqr.c b/compute/zunmqr.c
index 7e836f91f..89f33de1d 100644
--- a/compute/zunmqr.c
+++ b/compute/zunmqr.c
@@ -191,6 +191,7 @@ int MORSE_zunmqr( MORSE_enum side, MORSE_enum trans, int M, int N, int K,
                      MorseDescInput, MorseLower, sequence, &request );
     morse_ztile2lap( morse, &descCl, &descCt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
diff --git a/compute/zunmqr_param.c b/compute/zunmqr_param.c
index 45c88e575..f1d31036b 100644
--- a/compute/zunmqr_param.c
+++ b/compute/zunmqr_param.c
@@ -192,6 +192,8 @@ int MORSE_zunmqr_param( const libhqr_tree_t *qrtree,
                      MorseDescInput, MorseLower, sequence, &request );
     morse_ztile2lap( morse, &descCl, &descCt,
                      MorseDescInout, MorseUpperLower, sequence, &request );
+    MORSE_Desc_Flush( descTS, sequence );
+    MORSE_Desc_Flush( descTT, sequence );
 
     morse_sequence_wait( morse, sequence );
 
-- 
GitLab