Skip to content

Commit

Permalink
Update import statements and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Jan 6, 2024
1 parent 5d847a0 commit 57dc598
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 158 deletions.
6 changes: 3 additions & 3 deletions vlas/conversions.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import strconv
import math
import math.complex
import vsl.errors
import vsl.vlas.internal.vblas
import vsl.vlas.internal.blas

pub fn c_trans(trans bool) vblas.Transpose {
pub fn c_trans(trans bool) blas.Transpose {
return if trans { .trans } else { .no_trans }
}

pub fn c_uplo(up bool) vblas.Uplo {
pub fn c_uplo(up bool) blas.Uplo {
return if up { .upper } else { .lower }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

pub enum MemoryLayout {
row_major = 101
Expand Down
2 changes: 1 addition & 1 deletion vlas/internal/vblas/dgemm.v → vlas/internal/blas/dgemm.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

// import runtime
import sync
Expand Down
2 changes: 1 addition & 1 deletion vlas/internal/vblas/dgemv.v → vlas/internal/blas/dgemv.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

import vsl.float.float64
import math
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

fn test_dgemv_no_trans_1() {
expected := [0.0, 0, 0, 0, 0]
Expand Down
2 changes: 1 addition & 1 deletion vlas/internal/vblas/error.v → vlas/internal/blas/error.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

// Panic strings used during parameter checks.
// This list is duplicated in netlib/blas/netlib. Keep in sync.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

import vsl.float.float64
import math
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

import vsl.float.float64

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

import math
import vsl.float.float64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

import vsl.float.float64
import math
Expand Down
2 changes: 1 addition & 1 deletion vlas/internal/vblas/util.v → vlas/internal/blas/util.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module vblas
module blas

// [SD]gemm behavior constants. These are kept here to keep them out of the
// way during single precision code genration.
Expand Down
20 changes: 10 additions & 10 deletions vlas/lapack_common.v
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module vlas

import vsl.errors
import vsl.vlas.internal.vblas
import vsl.vlas.internal.blas

fn C.LAPACKE_dgesv(matrix_layout vblas.MemoryLayout, n int, nrhs int, a &f64, lda int, ipiv &int, b &f64, ldb int) int
fn C.LAPACKE_dgesv(matrix_layout blas.MemoryLayout, n int, nrhs int, a &f64, lda int, ipiv &int, b &f64, ldb int) int

fn C.LAPACKE_dgesvd(matrix_layout vblas.MemoryLayout, jobu &char, jobvt &char, m int, n int, a &f64, lda int, s &f64, u &f64, ldu int, vt &f64, ldvt int, superb &f64) int
fn C.LAPACKE_dgesvd(matrix_layout blas.MemoryLayout, jobu &char, jobvt &char, m int, n int, a &f64, lda int, s &f64, u &f64, ldu int, vt &f64, ldvt int, superb &f64) int

fn C.LAPACKE_dgetrf(matrix_layout vblas.MemoryLayout, m int, n int, a &f64, lda int, ipiv &int) int
fn C.LAPACKE_dgetrf(matrix_layout blas.MemoryLayout, m int, n int, a &f64, lda int, ipiv &int) int

fn C.LAPACKE_dgetri(matrix_layout vblas.MemoryLayout, n int, a &f64, lda int, ipiv &int) int
fn C.LAPACKE_dgetri(matrix_layout blas.MemoryLayout, n int, a &f64, lda int, ipiv &int) int

fn C.LAPACKE_dpotrf(matrix_layout vblas.MemoryLayout, up u32, n int, a &f64, lda int) int
fn C.LAPACKE_dpotrf(matrix_layout blas.MemoryLayout, up u32, n int, a &f64, lda int) int

fn C.LAPACKE_dgeev(matrix_layout vblas.MemoryLayout, calc_vl &char, calc_vr &char, n int, a &f64, lda int, wr &f64, wi &f64, vl &f64, ldvl_ int, vr &f64, ldvr_ int) int
fn C.LAPACKE_dgeev(matrix_layout blas.MemoryLayout, calc_vl &char, calc_vr &char, n int, a &f64, lda int, wr &f64, wi &f64, vl &f64, ldvl_ int, vr &f64, ldvr_ int) int

fn C.LAPACKE_dsyev(matrix_layout vblas.MemoryLayout, jobz byte, uplo byte, n int, a &f64, lda int, w &f64, work &f64, lwork int) int
fn C.LAPACKE_dsyev(matrix_layout blas.MemoryLayout, jobz byte, uplo byte, n int, a &f64, lda int, w &f64, work &f64, lwork int) int

fn C.LAPACKE_dgebal(matrix_layout vblas.MemoryLayout, job &char, n int, a &f64, lda int, ilo int, ihi int, scale &f64) int
fn C.LAPACKE_dgebal(matrix_layout blas.MemoryLayout, job &char, n int, a &f64, lda int, ilo int, ihi int, scale &f64) int

fn C.LAPACKE_dgehrd(matrix_layout vblas.MemoryLayout, n int, ilo int, ihi int, a &f64, lda int, tau &f64, work &f64, lwork int) int
fn C.LAPACKE_dgehrd(matrix_layout blas.MemoryLayout, n int, ilo int, ihi int, a &f64, lda int, tau &f64, work &f64, lwork int) int

// dgesv computes the solution to a real system of linear equations.
//
Expand Down
4 changes: 2 additions & 2 deletions vlas/lapack_default.c.v
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module vlas

import vsl.vlas.internal.vblas
import vsl.vlas.internal.blas

fn C.LAPACKE_dlange(matrix_layout vblas.MemoryLayout, norm &char, m int, n int, a &f64, lda int, work &f64) f64
fn C.LAPACKE_dlange(matrix_layout blas.MemoryLayout, norm &char, m int, n int, a &f64, lda int, work &f64) f64

pub fn dlange(norm rune, m int, n int, a []f64, lda int, work []f64) f64 {
return unsafe {
Expand Down
230 changes: 115 additions & 115 deletions vlas/oblas_d_vsl_vlas_cblas.v

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions vlas/oblas_notd_vsl_vlas_cblas.v
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
module vlas

import vsl.vlas.internal.vblas
import vsl.vlas.internal.blas

// set_num_threads sets the number of threads in VLAS
pub fn set_num_threads(n int) {}

@[inline]
pub fn ddot(n int, x []f64, incx int, y []f64, incy int) f64 {
return vblas.ddot(n, x, incx, y, incy)
return blas.ddot(n, x, incx, y, incy)
}

@[inline]
pub fn dasum(n int, x []f64, incx int) f64 {
return vblas.dasum(n, x, incx)
return blas.dasum(n, x, incx)
}

@[inline]
pub fn dnrm2(n int, x []f64, incx int) f64 {
return vblas.dnrm2(n, x, incx)
return blas.dnrm2(n, x, incx)
}

@[inline]
pub fn daxpy(n int, alpha f64, x []f64, incx int, mut y []f64, incy int) {
vblas.daxpy(n, alpha, x, incx, mut y, incy)
blas.daxpy(n, alpha, x, incx, mut y, incy)
}

@[inline]
pub fn dcopy(n int, x []f64, incx int, mut y []f64, incy int) {
vblas.dcopy(n, x, incx, mut y, incy)
blas.dcopy(n, x, incx, mut y, incy)
}

@[inline]
pub fn dswap(n int, mut x []f64, incx int, mut y []f64, incy int) {
vblas.dswap(n, mut x, incx, mut y, incy)
blas.dswap(n, mut x, incx, mut y, incy)
}

@[inline]
pub fn drot(n int, mut x []f64, incx int, mut y []f64, incy int, c f64, s f64) {
vblas.drot(n, mut x, incx, mut y, incy, c, s)
blas.drot(n, mut x, incx, mut y, incy, c, s)
}

@[inline]
pub fn dscal(n int, alpha f64, mut x []f64, incx int) {
vblas.dscal(n, alpha, mut x, incx)
blas.dscal(n, alpha, mut x, incx)
}

@[inline]
pub fn dgemv(trans bool, m int, n int, alpha f64, a []f64, lda int, x []f64, incx int, beta f64, mut y []f64, incy int) {
vblas.dgemv(c_trans(trans), m, n, alpha, a, lda, x, incx, beta, mut y, incy)
blas.dgemv(c_trans(trans), m, n, alpha, a, lda, x, incx, beta, mut y, incy)
}

@[inline]
pub fn dger(m int, n int, alpha f64, x []f64, incx int, y []f64, incy int, mut a []f64, lda int) {
vblas.dger(m, n, alpha, x, incx, y, incy, mut a, lda)
blas.dger(m, n, alpha, x, incx, y, incy, mut a, lda)
}

@[inline]
pub fn dtrsv(uplo bool, trans_a bool, diag vblas.Diagonal, n int, a []f64, lda int, mut x []f64, incx int) {
vblas.dtrsv(c_uplo(uplo), c_trans(trans_a), diag, n, a, lda, mut x, incx)
pub fn dtrsv(uplo bool, trans_a bool, diag blas.Diagonal, n int, a []f64, lda int, mut x []f64, incx int) {
blas.dtrsv(c_uplo(uplo), c_trans(trans_a), diag, n, a, lda, mut x, incx)
}

@[inline]
pub fn dtrmv(uplo bool, trans_a bool, diag vblas.Diagonal, n int, a []f64, lda int, mut x []f64, incx int) {
vblas.dtrmv(c_uplo(uplo), c_trans(trans_a), diag, n, a, lda, mut x, incx)
pub fn dtrmv(uplo bool, trans_a bool, diag blas.Diagonal, n int, a []f64, lda int, mut x []f64, incx int) {
blas.dtrmv(c_uplo(uplo), c_trans(trans_a), diag, n, a, lda, mut x, incx)
}

@[inline]
pub fn dsyr(uplo bool, n int, alpha f64, x []f64, incx int, mut a []f64, lda int) {
vblas.dsyr(c_uplo(uplo), n, alpha, x, incx, mut a, lda)
blas.dsyr(c_uplo(uplo), n, alpha, x, incx, mut a, lda)
}

@[inline]
pub fn dsyr2(uplo bool, n int, alpha f64, x []f64, incx int, y []f64, incy int, mut a []f64, lda int) {
vblas.dsyr2(c_uplo(uplo), n, alpha, x, incx, y, incy, mut a, lda)
blas.dsyr2(c_uplo(uplo), n, alpha, x, incx, y, incy, mut a, lda)
}

@[inline]
pub fn dgemm(trans_a bool, trans_b bool, m int, n int, k int, alpha f64, a []f64, lda int, b []f64, ldb int, beta f64, mut cc []f64, ldc int) {
vblas.dgemm(c_trans(trans_a), c_trans(trans_b), m, n, k, alpha, a, lda, b, ldb, beta, mut
blas.dgemm(c_trans(trans_a), c_trans(trans_b), m, n, k, alpha, a, lda, b, ldb, beta, mut
cc, ldc)
}

0 comments on commit 57dc598

Please sign in to comment.