Skip to content

Commit

Permalink
refactor: Update LAPACK functions in lapack_notd_vsl_lapack_lapacke.v…
Browse files Browse the repository at this point in the history
… to handle errors and use named constants
  • Loading branch information
ulises-jeremias committed Jun 23, 2024
1 parent 5f9a1fe commit e83de29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
14 changes: 0 additions & 14 deletions lapack/cflags_notd_vsl_lapack_lapacke.v

This file was deleted.

8 changes: 4 additions & 4 deletions lapack/lapack_notd_vsl_lapack_lapacke.v
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn dgesvd(jobu SVDJob, jobvt SVDJob, m int, n int, mut a []f64, lda int, s [
info := lapack64.dgesvd(jobu, jobvt, m, n, mut a, lda, s, mut u, ldu, mut vt, ldvt,
superb)
if info != 0 {
errors.vsl_panic('lapack failed', .efailed)
errors.vsl_panic('LAPACK dgesvd failed with error code: $info', .efailed)
}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ pub fn dgetrf(m int, n int, mut a []f64, lda int, mut ipiv []int) {
pub fn dgetri(n int, mut a []f64, lda int, mut ipiv []int) {
info := lapack64.dgetri(n, mut a, lda, mut ipiv)
if info != 0 {
errors.vsl_panic('lapack failed', .efailed)
errors.vsl_panic('LAPACK dgesvd failed with error code: $info', .efailed)
}
}

Expand All @@ -114,7 +114,7 @@ pub fn dgetri(n int, mut a []f64, lda int, mut ipiv []int) {
pub fn dpotrf(uplo blas.Uplo, n int, mut a []f64, lda int) {
info := lapack64.dpotrf(uplo, n, mut a, lda)
if info != 0 {
errors.vsl_panic('lapack failed', .efailed)
errors.vsl_panic('LAPACK dgesvd failed with error code: $info', .efailed)
}
}

Expand Down Expand Up @@ -163,6 +163,6 @@ pub fn dgeev(calc_vl LeftEVJob, calc_vr LeftEVJob, n int, mut a []f64, lda int,
info := lapack64.dgeev(calc_vl, calc_vr, n, mut a, lda, wr, wi, mut vl, ldvl, mut
vr, ldvr)
if info != 0 {
errors.vsl_panic('lapack failed', .efailed)
errors.vsl_panic('LAPACK dgesvd failed with error code: $info', .efailed)
}
}

0 comments on commit e83de29

Please sign in to comment.