diff options
author | julie <julielangou@users.noreply.github.com> | 2016-02-23 05:12:12 +0000 |
---|---|---|
committer | julie <julielangou@users.noreply.github.com> | 2016-02-23 05:12:12 +0000 |
commit | f365f88227642d06b1132657f849bdc043e30d31 (patch) | |
tree | 01a340dd3dd93777da8d3908802c322f993127a5 /SRC/cuncsd2by1.f | |
parent | e231fa283ee3efc2005318f3cf5f43d338a03166 (diff) | |
download | lapack-f365f88227642d06b1132657f849bdc043e30d31.tar.gz lapack-f365f88227642d06b1132657f849bdc043e30d31.tar.bz2 lapack-f365f88227642d06b1132657f849bdc043e30d31.zip |
APPLYING INTEL PATCHES sent to Julie on Feb 19th 2016 by Dima from INTEL (dmitry.g.baksheev@intel.com)
Subject: [PATCH 06/42] Fix ???CSD2BY1 - workspace query should not pass bad LD to ???GQR/GLQ
Diffstat (limited to 'SRC/cuncsd2by1.f')
-rw-r--r-- | SRC/cuncsd2by1.f | 102 |
1 files changed, 59 insertions, 43 deletions
diff --git a/SRC/cuncsd2by1.f b/SRC/cuncsd2by1.f index 1b2b0fb2..f431b337 100644 --- a/SRC/cuncsd2by1.f +++ b/SRC/cuncsd2by1.f @@ -320,11 +320,11 @@ INFO = -8 ELSE IF( LDX21 .LT. MAX( 1, M-P ) ) THEN INFO = -10 - ELSE IF( WANTU1 .AND. LDU1 .LT. P ) THEN + ELSE IF( WANTU1 .AND. LDU1 .LT. MAX( 1, P ) ) THEN INFO = -13 - ELSE IF( WANTU2 .AND. LDU2 .LT. M - P ) THEN + ELSE IF( WANTU2 .AND. LDU2 .LT. MAX( 1, M - P ) ) THEN INFO = -15 - ELSE IF( WANTV1T .AND. LDV1T .LT. Q ) THEN + ELSE IF( WANTV1T .AND. LDV1T .LT. MAX( 1, Q ) ) THEN INFO = -17 END IF * @@ -380,25 +380,32 @@ IORBDB = ITAUQ1 + MAX( 1, Q ) IORGQR = ITAUQ1 + MAX( 1, Q ) IORGLQ = ITAUQ1 + MAX( 1, Q ) + LORGQRMIN = 1 + LORGQROPT = 1 + LORGLQMIN = 1 + LORGLQOPT = 1 IF( R .EQ. Q ) THEN CALL CUNBDB1( M, P, Q, X11, LDX11, X21, LDX21, THETA, 0, 0, $ 0, 0, WORK, -1, CHILDINFO ) LORBDB = INT( WORK(1) ) - IF( P .GE. M-P ) THEN + IF( WANTU1 .AND. P .GT. 0 ) THEN CALL CUNGQR( P, P, Q, U1, LDU1, 0, WORK(1), -1, $ CHILDINFO ) - LORGQRMIN = MAX( 1, P ) - LORGQROPT = INT( WORK(1) ) - ELSE + LORGQRMIN = MAX( LORGQRMIN, P ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + ENDIF + IF( WANTU2 .AND. M-P .GT. 0 ) THEN CALL CUNGQR( M-P, M-P, Q, U2, LDU2, 0, WORK(1), -1, $ CHILDINFO ) - LORGQRMIN = MAX( 1, M-P ) - LORGQROPT = INT( WORK(1) ) + LORGQRMIN = MAX( LORGQRMIN, M-P ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTV1T .AND. Q .GT. 0 ) THEN + CALL CUNGLQ( Q-1, Q-1, Q-1, V1T, LDV1T, + $ 0, WORK(1), -1, CHILDINFO ) + LORGLQMIN = MAX( LORGLQMIN, Q-1 ) + LORGLQOPT = MAX( LORGLQOPT, INT( WORK(1) ) ) END IF - CALL CUNGLQ( MAX(0,Q-1), MAX(0,Q-1), MAX(0,Q-1), V1T, LDV1T, - $ 0, WORK(1), -1, CHILDINFO ) - LORGLQMIN = MAX( 1, Q-1 ) - LORGLQOPT = INT( WORK(1) ) CALL CBBCSD( JOBU1, JOBU2, JOBV1T, 'N', 'N', M, P, Q, THETA, $ 0, U1, LDU1, U2, LDU2, V1T, LDV1T, 0, 1, 0, 0, $ 0, 0, 0, 0, 0, 0, RWORK(1), -1, CHILDINFO ) @@ -407,21 +414,24 @@ CALL CUNBDB2( M, P, Q, X11, LDX11, X21, LDX21, THETA, 0, 0, $ 0, 0, WORK(1), -1, CHILDINFO ) LORBDB = INT( WORK(1) ) - IF( P-1 .GE. M-P ) THEN + IF( WANTU1 .AND. P .GT. 0 ) THEN CALL CUNGQR( P-1, P-1, P-1, U1(2,2), LDU1, 0, WORK(1), $ -1, CHILDINFO ) - LORGQRMIN = MAX( 1, P-1 ) - LORGQROPT = INT( WORK(1) ) - ELSE + LORGQRMIN = MAX( LORGQRMIN, P-1 ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTU2 .AND. M-P .GT. 0 ) THEN CALL CUNGQR( M-P, M-P, Q, U2, LDU2, 0, WORK(1), -1, $ CHILDINFO ) - LORGQRMIN = MAX( 1, M-P ) - LORGQROPT = INT( WORK(1) ) + LORGQRMIN = MAX( LORGQRMIN, M-P ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTV1T .AND. Q .GT. 0 ) THEN + CALL CUNGLQ( Q, Q, R, V1T, LDV1T, 0, WORK(1), -1, + $ CHILDINFO ) + LORGLQMIN = MAX( LORGLQMIN, Q ) + LORGLQOPT = MAX( LORGLQOPT, INT( WORK(1) ) ) END IF - CALL CUNGLQ( Q, Q, R, V1T, LDV1T, 0, WORK(1), -1, - $ CHILDINFO ) - LORGLQMIN = MAX( 1, Q ) - LORGLQOPT = INT( WORK(1) ) CALL CBBCSD( JOBV1T, 'N', JOBU1, JOBU2, 'T', M, Q, P, THETA, $ 0, V1T, LDV1T, 0, 1, U1, LDU1, U2, LDU2, 0, 0, $ 0, 0, 0, 0, 0, 0, RWORK(1), -1, CHILDINFO ) @@ -430,21 +440,24 @@ CALL CUNBDB3( M, P, Q, X11, LDX11, X21, LDX21, THETA, 0, 0, $ 0, 0, WORK(1), -1, CHILDINFO ) LORBDB = INT( WORK(1) ) - IF( P .GE. M-P-1 ) THEN + IF( WANTU1 .AND. P .GT. 0 ) THEN CALL CUNGQR( P, P, Q, U1, LDU1, 0, WORK(1), -1, $ CHILDINFO ) - LORGQRMIN = MAX( 1, P ) - LORGQROPT = INT( WORK(1) ) - ELSE + LORGQRMIN = MAX( LORGQRMIN, P ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTU2 .AND. M-P .GT. 0 ) THEN CALL CUNGQR( M-P-1, M-P-1, M-P-1, U2(2,2), LDU2, 0, $ WORK(1), -1, CHILDINFO ) - LORGQRMIN = MAX( 1, M-P-1 ) - LORGQROPT = INT( WORK(1) ) + LORGQRMIN = MAX( LORGQRMIN, M-P-1 ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTV1T .AND. Q .GT. 0 ) THEN + CALL CUNGLQ( Q, Q, R, V1T, LDV1T, 0, WORK(1), -1, + $ CHILDINFO ) + LORGLQMIN = MAX( LORGLQMIN, Q ) + LORGLQOPT = MAX( LORGLQOPT, INT( WORK(1) ) ) END IF - CALL CUNGLQ( Q, Q, R, V1T, LDV1T, 0, WORK(1), -1, - $ CHILDINFO ) - LORGLQMIN = MAX( 1, Q ) - LORGLQOPT = INT( WORK(1) ) CALL CBBCSD( 'N', JOBV1T, JOBU2, JOBU1, 'T', M, M-Q, M-P, $ THETA, 0, 0, 1, V1T, LDV1T, U2, LDU2, U1, LDU1, $ 0, 0, 0, 0, 0, 0, 0, 0, RWORK(1), -1, @@ -454,21 +467,24 @@ CALL CUNBDB4( M, P, Q, X11, LDX11, X21, LDX21, THETA, 0, 0, $ 0, 0, 0, WORK(1), -1, CHILDINFO ) LORBDB = M + INT( WORK(1) ) - IF( P .GE. M-P ) THEN + IF( WANTU1 .AND. P .GT. 0 ) THEN CALL CUNGQR( P, P, M-Q, U1, LDU1, 0, WORK(1), -1, $ CHILDINFO ) - LORGQRMIN = MAX( 1, P ) - LORGQROPT = INT( WORK(1) ) - ELSE + LORGQRMIN = MAX( LORGQRMIN, P ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTU2 .AND. M-P .GT. 0 ) THEN CALL CUNGQR( M-P, M-P, M-Q, U2, LDU2, 0, WORK(1), -1, $ CHILDINFO ) - LORGQRMIN = MAX( 1, M-P ) - LORGQROPT = INT( WORK(1) ) + LORGQRMIN = MAX( LORGQRMIN, M-P ) + LORGQROPT = MAX( LORGQROPT, INT( WORK(1) ) ) + END IF + IF( WANTV1T .AND. Q .GT. 0 ) THEN + CALL CUNGLQ( Q, Q, Q, V1T, LDV1T, 0, WORK(1), -1, + $ CHILDINFO ) + LORGLQMIN = MAX( LORGLQMIN, Q ) + LORGLQOPT = MAX( LORGLQOPT, INT( WORK(1) ) ) END IF - CALL CUNGLQ( Q, Q, Q, V1T, LDV1T, 0, WORK(1), -1, - $ CHILDINFO ) - LORGLQMIN = MAX( 1, Q ) - LORGLQOPT = INT( WORK(1) ) CALL CBBCSD( JOBU2, JOBU1, 'N', JOBV1T, 'N', M, M-P, M-Q, $ THETA, 0, U2, LDU2, U1, LDU1, 0, 1, V1T, LDV1T, $ 0, 0, 0, 0, 0, 0, 0, 0, RWORK(1), -1, |