Skip to content

Commit

Permalink
Don't copy data in for output variables: to_lapack_int can throw on u…
Browse files Browse the repository at this point in the history
…ninitialized data. Update generator script.
  • Loading branch information
mgates3 committed Oct 24, 2024
1 parent bd42886 commit 7c6aecd
Show file tree
Hide file tree
Showing 46 changed files with 373 additions and 359 deletions.
8 changes: 4 additions & 4 deletions src/bdsvdx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "lapack/fortran.h"
#include "NoConstructAllocator.hh"

#if LAPACK_VERSION >= 30600 // >= v3.6
#if LAPACK_VERSION >= 30600 // >= 3.6.0

#include <vector>

Expand All @@ -34,7 +34,7 @@ int64_t bdsvdx(
lapack_int n_ = to_lapack_int( n );
lapack_int il_ = to_lapack_int( il );
lapack_int iu_ = to_lapack_int( iu );
lapack_int nfound_ = to_lapack_int( *nfound );
lapack_int nfound_ = 0;
lapack_int ldz_ = to_lapack_int( ldz );
lapack_int info_ = 0;

Expand Down Expand Up @@ -202,7 +202,7 @@ int64_t bdsvdx(
lapack_int n_ = to_lapack_int( n );
lapack_int il_ = to_lapack_int( il );
lapack_int iu_ = to_lapack_int( iu );
lapack_int nfound_ = to_lapack_int( *nfound );
lapack_int nfound_ = 0;
lapack_int ldz_ = to_lapack_int( ldz );
lapack_int info_ = 0;

Expand All @@ -228,4 +228,4 @@ int64_t bdsvdx(

} // namespace lapack

#endif // LAPACK >= v3.6
#endif // LAPACK >= 3.6.0
16 changes: 8 additions & 8 deletions src/gebal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ int64_t gebal(
char balance_ = to_char( balance );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

LAPACK_sgebal(
Expand Down Expand Up @@ -56,8 +56,8 @@ int64_t gebal(
char balance_ = to_char( balance );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

LAPACK_dgebal(
Expand Down Expand Up @@ -85,8 +85,8 @@ int64_t gebal(
char balance_ = to_char( balance );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

LAPACK_cgebal(
Expand Down Expand Up @@ -203,8 +203,8 @@ int64_t gebal(
char balance_ = to_char( balance );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

LAPACK_zgebal(
Expand Down
4 changes: 2 additions & 2 deletions src/gees.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int64_t gees(
char sort_ = to_char( sort );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvs_ = to_lapack_int( ldvs );
lapack_int info_ = 0;

Expand Down Expand Up @@ -214,7 +214,7 @@ int64_t gees(
char sort_ = to_char( sort );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvs_ = to_lapack_int( ldvs );
lapack_int info_ = 0;

Expand Down
8 changes: 4 additions & 4 deletions src/geesx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int64_t geesx(
char sense_ = to_char( sense );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvs_ = to_lapack_int( ldvs );
lapack_int info_ = 0;

Expand Down Expand Up @@ -103,7 +103,7 @@ int64_t geesx(
char sense_ = to_char( sense );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvs_ = to_lapack_int( ldvs );
lapack_int info_ = 0;

Expand Down Expand Up @@ -175,7 +175,7 @@ int64_t geesx(
char sense_ = to_char( sense );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvs_ = to_lapack_int( ldvs );
lapack_int info_ = 0;

Expand Down Expand Up @@ -236,7 +236,7 @@ int64_t geesx(
char sense_ = to_char( sense );
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvs_ = to_lapack_int( ldvs );
lapack_int info_ = 0;

Expand Down
8 changes: 4 additions & 4 deletions src/gelsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int64_t gelsd(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -82,7 +82,7 @@ int64_t gelsd(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -134,7 +134,7 @@ int64_t gelsd(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -272,7 +272,7 @@ int64_t gelsd(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down
8 changes: 4 additions & 4 deletions src/gelss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int64_t gelss(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -77,7 +77,7 @@ int64_t gelss(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -124,7 +124,7 @@ int64_t gelss(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -242,7 +242,7 @@ int64_t gelss(
lapack_int nrhs_ = to_lapack_int( nrhs );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down
8 changes: 4 additions & 4 deletions src/gelsy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int64_t gelsy(
#else
lapack_int* jpvt_ptr = jpvt;
#endif
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -94,7 +94,7 @@ int64_t gelsy(
#else
lapack_int* jpvt_ptr = jpvt;
#endif
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -151,7 +151,7 @@ int64_t gelsy(
#else
lapack_int* jpvt_ptr = jpvt;
#endif
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down Expand Up @@ -311,7 +311,7 @@ int64_t gelsy(
#else
lapack_int* jpvt_ptr = jpvt;
#endif
lapack_int rank_ = to_lapack_int( *rank );
lapack_int rank_ = 0;
lapack_int info_ = 0;

// query for workspace size
Expand Down
4 changes: 2 additions & 2 deletions src/gesv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ int64_t gesv(
#endif
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int ldx_ = to_lapack_int( ldx );
lapack_int iter_ = to_lapack_int( *iter );
lapack_int iter_ = 0;
lapack_int info_ = 0;

// allocate workspace
Expand Down Expand Up @@ -272,7 +272,7 @@ int64_t gesv(
#endif
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int ldx_ = to_lapack_int( ldx );
lapack_int iter_ = to_lapack_int( *iter );
lapack_int iter_ = 0;
lapack_int info_ = 0;

// allocate workspace
Expand Down
12 changes: 6 additions & 6 deletions src/gesvdx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "lapack/fortran.h"
#include "NoConstructAllocator.hh"

#if LAPACK_VERSION >= 30600 // >= v3.6
#if LAPACK_VERSION >= 30600 // >= 3.6.0

#include <vector>

Expand Down Expand Up @@ -36,7 +36,7 @@ int64_t gesvdx(
lapack_int lda_ = to_lapack_int( lda );
lapack_int il_ = to_lapack_int( il );
lapack_int iu_ = to_lapack_int( iu );
lapack_int nfound_ = to_lapack_int( *nfound );
lapack_int nfound_ = 0;
lapack_int ldu_ = to_lapack_int( ldu );
lapack_int ldvt_ = to_lapack_int( ldvt );
lapack_int info_ = 0;
Expand Down Expand Up @@ -97,7 +97,7 @@ int64_t gesvdx(
lapack_int lda_ = to_lapack_int( lda );
lapack_int il_ = to_lapack_int( il );
lapack_int iu_ = to_lapack_int( iu );
lapack_int nfound_ = to_lapack_int( *nfound );
lapack_int nfound_ = 0;
lapack_int ldu_ = to_lapack_int( ldu );
lapack_int ldvt_ = to_lapack_int( ldvt );
lapack_int info_ = 0;
Expand Down Expand Up @@ -158,7 +158,7 @@ int64_t gesvdx(
lapack_int lda_ = to_lapack_int( lda );
lapack_int il_ = to_lapack_int( il );
lapack_int iu_ = to_lapack_int( iu );
lapack_int nfound_ = to_lapack_int( *nfound );
lapack_int nfound_ = 0;
lapack_int ldu_ = to_lapack_int( ldu );
lapack_int ldvt_ = to_lapack_int( ldvt );
lapack_int info_ = 0;
Expand Down Expand Up @@ -353,7 +353,7 @@ int64_t gesvdx(
lapack_int lda_ = to_lapack_int( lda );
lapack_int il_ = to_lapack_int( il );
lapack_int iu_ = to_lapack_int( iu );
lapack_int nfound_ = to_lapack_int( *nfound );
lapack_int nfound_ = 0;
lapack_int ldu_ = to_lapack_int( ldu );
lapack_int ldvt_ = to_lapack_int( ldvt );
lapack_int info_ = 0;
Expand Down Expand Up @@ -405,4 +405,4 @@ int64_t gesvdx(

} // namespace lapack

#endif // LAPACK >= v3.6
#endif // LAPACK >= 3.6.0
16 changes: 8 additions & 8 deletions src/ggbal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ int64_t ggbal(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

// from docs
Expand Down Expand Up @@ -70,8 +70,8 @@ int64_t ggbal(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

// from docs
Expand Down Expand Up @@ -110,8 +110,8 @@ int64_t ggbal(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

// from docs
Expand Down Expand Up @@ -150,8 +150,8 @@ int64_t ggbal(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int ilo_ = to_lapack_int( *ilo );
lapack_int ihi_ = to_lapack_int( *ihi );
lapack_int ilo_ = 0;
lapack_int ihi_ = 0;
lapack_int info_ = 0;

// from docs
Expand Down
8 changes: 4 additions & 4 deletions src/gges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int64_t gges(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvsl_ = to_lapack_int( ldvsl );
lapack_int ldvsr_ = to_lapack_int( ldvsr );
lapack_int info_ = 0;
Expand Down Expand Up @@ -111,7 +111,7 @@ int64_t gges(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvsl_ = to_lapack_int( ldvsl );
lapack_int ldvsr_ = to_lapack_int( ldvsr );
lapack_int info_ = 0;
Expand Down Expand Up @@ -188,7 +188,7 @@ int64_t gges(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvsl_ = to_lapack_int( ldvsl );
lapack_int ldvsr_ = to_lapack_int( ldvsr );
lapack_int info_ = 0;
Expand Down Expand Up @@ -259,7 +259,7 @@ int64_t gges(
lapack_int n_ = to_lapack_int( n );
lapack_int lda_ = to_lapack_int( lda );
lapack_int ldb_ = to_lapack_int( ldb );
lapack_int sdim_ = to_lapack_int( *sdim );
lapack_int sdim_ = 0;
lapack_int ldvsl_ = to_lapack_int( ldvsl );
lapack_int ldvsr_ = to_lapack_int( ldvsr );
lapack_int info_ = 0;
Expand Down
Loading

0 comments on commit 7c6aecd

Please sign in to comment.