From e54144dbd7d064c8bfed4fa31d133883b81894e8 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Mon, 20 Oct 2014 13:22:20 -0700 Subject: [PATCH] alternate version of blas_suffix renaming using a function instead of a macro --- base/linalg/blas.jl | 238 +++++++++---------- base/linalg/lapack.jl | 526 +++++++++++++++++++++--------------------- base/util.jl | 8 +- 3 files changed, 384 insertions(+), 388 deletions(-) diff --git a/base/linalg/blas.jl b/base/linalg/blas.jl index f6a2a559b123f..6c52b7b6c904f 100644 --- a/base/linalg/blas.jl +++ b/base/linalg/blas.jl @@ -1,7 +1,7 @@ module BLAS import ..axpy! -import Base: copy!, @blas_suffix +import Base: copy!, blas_suffix export # Level 1 @@ -57,14 +57,14 @@ import ..LinAlg: BlasReal, BlasComplex, BlasFloat, BlasChar, BlasInt, blas_int, # Level 1 ## copy -for (fname, elty) in ((@blas_suffix(:dcopy_),:Float64), - (@blas_suffix(:scopy_),:Float32), - (@blas_suffix(:zcopy_),:Complex128), - (@blas_suffix(:ccopy_),:Complex64)) +for (fname, elty) in ((:dcopy_,:Float64), + (:scopy_,:Float32), + (:zcopy_,:Complex128), + (:ccopy_,:Complex64)) @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, DX, &incx, DY, &incy) DY @@ -73,14 +73,14 @@ for (fname, elty) in ((@blas_suffix(:dcopy_),:Float64), end ## scal -for (fname, elty) in ((@blas_suffix(:dscal_),:Float64), - (@blas_suffix(:sscal_),:Float32), - (@blas_suffix(:zscal_),:Complex128), - (@blas_suffix(:cscal_),:Complex64)) +for (fname, elty) in ((:dscal_,:Float64), + (:sscal_,:Float32), + (:zscal_,:Complex128), + (:cscal_,:Complex64)) @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), &n, &DA, DX, &incx) DX @@ -89,11 +89,11 @@ for (fname, elty) in ((@blas_suffix(:dscal_),:Float64), end scal(n, DA, DX, incx) = scal!(n, DA, copy(DX), incx) # In case DX is complex, and DA is real, use dscal/sscal to save flops -for (fname, elty, celty) in ((@blas_suffix(:sscal_), :Float32, :Complex64), - (@blas_suffix(:dscal_), :Float64, :Complex128)) +for (fname, elty, celty) in ((:sscal_, :Float32, :Complex64), + (:dscal_, :Float64, :Complex128)) @eval begin function scal!(n::Integer, DA::$elty, DX::Union(Ptr{$celty},StridedArray{$celty}), incx::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$celty}, Ptr{BlasInt}), &(2*n), &DA, DX, &incx) DX @@ -102,8 +102,8 @@ for (fname, elty, celty) in ((@blas_suffix(:sscal_), :Float32, :Complex64), end ## dot -for (fname, elty) in ((@blas_suffix(:ddot_),:Float64), - (@blas_suffix(:sdot_),:Float32)) +for (fname, elty) in ((:ddot_,:Float64), + (:sdot_,:Float32)) @eval begin # DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX,DY,INCY) # * .. Scalar Arguments .. @@ -112,14 +112,14 @@ for (fname, elty) in ((@blas_suffix(:ddot_),:Float64), # * .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function dot(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) - ccall(($(string(fname)),libblas), $elty, + ccall(($(blas_suffix(fname)), libblas), $elty, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, DX, &incx, DY, &incy) end end end -for (fname, elty) in ((@blas_suffix(:cblas_zdotc_sub),:Complex128), - (@blas_suffix(:cblas_cdotc_sub),:Complex64)) +for (fname, elty) in ((:cblas_zdotc_sub,:Complex128), + (:cblas_cdotc_sub,:Complex64)) @eval begin # DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX,DY,INCY) # * .. Scalar Arguments .. @@ -129,15 +129,15 @@ for (fname, elty) in ((@blas_suffix(:cblas_zdotc_sub),:Complex128), # DOUBLE PRECISION DX(*),DY(*) function dotc(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) result = Array($elty, 1) - ccall(($(string(fname)),libblas), $elty, + ccall(($(blas_suffix(fname)), libblas), $elty, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[1] end end end -for (fname, elty) in ((@blas_suffix(:cblas_zdotu_sub),:Complex128), - (@blas_suffix(:cblas_cdotu_sub),:Complex64)) +for (fname, elty) in ((:cblas_zdotu_sub,:Complex128), + (:cblas_cdotu_sub,:Complex64)) @eval begin # DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX,DY,INCY) # * .. Scalar Arguments .. @@ -147,7 +147,7 @@ for (fname, elty) in ((@blas_suffix(:cblas_zdotu_sub),:Complex128), # DOUBLE PRECISION DX(*),DY(*) function dotu(n::Integer, DX::Union(Ptr{$elty},StridedArray{$elty}), incx::Integer, DY::Union(Ptr{$elty},StridedArray{$elty}), incy::Integer) result = Array($elty, 1) - ccall(($(string(fname)),libblas), $elty, + ccall(($(blas_suffix(fname)), libblas), $elty, (BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}, BlasInt, Ptr{$elty}), n, DX, incx, DY, incy, result) result[1] @@ -171,14 +171,14 @@ function dotu{T<:BlasComplex}(DX::StridedArray{T}, DY::StridedArray{T}) end ## nrm2 -for (fname, elty, ret_type) in ((@blas_suffix(:dnrm2_),:Float64,:Float64), - (@blas_suffix(:snrm2_),:Float32,:Float32), - (@blas_suffix(:dznrm2_),:Complex128,:Float64), - (@blas_suffix(:scnrm2_),:Complex64,:Float32)) +for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64), + (:snrm2_,:Float32,:Float32), + (:dznrm2_,:Complex128,:Float64), + (:scnrm2_,:Complex64,:Float32)) @eval begin # SUBROUTINE DNRM2(N,X,INCX) function nrm2(n::Integer, X::Union(Ptr{$elty},StridedVector{$elty}), incx::Integer) - ccall(($(string(fname)),libblas), $ret_type, + ccall(($(blas_suffix(fname)), libblas), $ret_type, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, X, &incx) end @@ -188,14 +188,14 @@ nrm2(x::StridedVector) = nrm2(length(x), x, stride(x,1)) nrm2(x::Array) = nrm2(length(x), pointer(x), 1) ## asum -for (fname, elty, ret_type) in ((@blas_suffix(:dasum_),:Float64,:Float64), - (@blas_suffix(:sasum_),:Float32,:Float32), - (@blas_suffix(:dzasum_),:Complex128,:Float64), - (@blas_suffix(:scasum_),:Complex64,:Float32)) +for (fname, elty, ret_type) in ((:dasum_,:Float64,:Float64), + (:sasum_,:Float32,:Float32), + (:dzasum_,:Complex128,:Float64), + (:scasum_,:Complex64,:Float32)) @eval begin # SUBROUTINE ASUM(N, X, INCX) function asum(n::Integer, X::Union(Ptr{$elty},StridedVector{$elty}), incx::Integer) - ccall(($(string(fname)),libblas), $ret_type, + ccall(($(blas_suffix(fname)), libblas), $ret_type, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, X, &incx) end @@ -205,10 +205,10 @@ asum(x::StridedVector) = asum(length(x), x, stride(x,1)) asum(x::Array) = asum(length(x), pointer(x), 1) ## axpy -for (fname, elty) in ((@blas_suffix(:daxpy_),:Float64), - (@blas_suffix(:saxpy_),:Float32), - (@blas_suffix(:zaxpy_),:Complex128), - (@blas_suffix(:caxpy_),:Complex64)) +for (fname, elty) in ((:daxpy_,:Float64), + (:saxpy_,:Float32), + (:zaxpy_,:Complex128), + (:caxpy_,:Complex64)) @eval begin # SUBROUTINE DAXPY(N,DA,DX,INCX,DY,INCY) # DY <- DA*DX + DY @@ -218,7 +218,7 @@ for (fname, elty) in ((@blas_suffix(:daxpy_),:Float64), #* .. Array Arguments .. # DOUBLE PRECISION DX(*),DY(*) function axpy!(n::Integer, alpha::($elty), dx::Union(Ptr{$elty}, StridedArray{$elty}), incx::Integer, dy::Union(Ptr{$elty}, StridedArray{$elty}), incy::Integer) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, &alpha, dx, &incx, dy, &incy) dy @@ -243,13 +243,13 @@ function axpy!{T<:BlasFloat,Ta<:Number,Ti<:Integer}(alpha::Ta, x::Array{T}, rx:: end ## iamax -for (fname, elty) in ((@blas_suffix(:idamax_),:Float64), - (@blas_suffix(:isamax_),:Float32), - (@blas_suffix(:izamax_),:Complex128), - (@blas_suffix(:icamax_),:Complex64)) +for (fname, elty) in ((:idamax_,:Float64), + (:isamax_,:Float32), + (:izamax_,:Complex128), + (:icamax_,:Complex64)) @eval begin function iamax(n::BlasInt, dx::Union(StridedVector{$elty}, Ptr{$elty}), incx::BlasInt) - ccall(($(string(fname)), libblas),BlasInt, + ccall(($(blas_suffix(fname)), libblas),BlasInt, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &n, dx, &incx) end @@ -260,10 +260,10 @@ iamax(dx::StridedVector) = iamax(length(dx), dx, 1) # Level 2 ## mv ### gemv -for (fname, elty) in ((@blas_suffix(:dgemv_),:Float64), - (@blas_suffix(:sgemv_),:Float32), - (@blas_suffix(:zgemv_),:Complex128), - (@blas_suffix(:cgemv_),:Complex64)) +for (fname, elty) in ((:dgemv_,:Float64), + (:sgemv_,:Float32), + (:zgemv_,:Complex128), + (:cgemv_,:Complex64)) @eval begin #SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) #* .. Scalar Arguments .. @@ -275,7 +275,7 @@ for (fname, elty) in ((@blas_suffix(:dgemv_),:Float64), function gemv!(trans::BlasChar, alpha::($elty), A::StridedVecOrMat{$elty}, X::StridedVector{$elty}, beta::($elty), Y::StridedVector{$elty}) m,n = size(A,1),size(A,2) length(X) == (trans == 'N' ? n : m) && length(Y) == (trans == 'N' ? m : n) || throw(DimensionMismatch("")) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -294,10 +294,10 @@ for (fname, elty) in ((@blas_suffix(:dgemv_),:Float64), end ### (GB) general banded matrix-vector multiplication -for (fname, elty) in ((@blas_suffix(:dgbmv_),:Float64), - (@blas_suffix(:sgbmv_),:Float32), - (@blas_suffix(:zgbmv_),:Complex128), - (@blas_suffix(:cgbmv_),:Complex64)) +for (fname, elty) in ((:dgbmv_,:Float64), + (:sgbmv_,:Float32), + (:zgbmv_,:Complex128), + (:cgbmv_,:Complex64)) @eval begin # SUBROUTINE DGBMV(TRANS,M,N,KL,KU,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) # * .. Scalar Arguments .. @@ -307,7 +307,7 @@ for (fname, elty) in ((@blas_suffix(:dgbmv_),:Float64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function gbmv!(trans::BlasChar, m::Integer, kl::Integer, ku::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -329,10 +329,10 @@ for (fname, elty) in ((@blas_suffix(:dgbmv_),:Float64), end ### symv -for (fname, elty) in ((@blas_suffix(:dsymv_),:Float64), - (@blas_suffix(:ssymv_),:Float32), - (@blas_suffix(:zsymv_),:Complex128), - (@blas_suffix(:csymv_),:Complex64)) +for (fname, elty) in ((:dsymv_,:Float64), + (:ssymv_,:Float32), + (:zsymv_,:Complex128), + (:csymv_,:Complex64)) # Note that the complex symv are not BLAS but auiliary functions in LAPACK @eval begin # SUBROUTINE DSYMV(UPLO,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -346,7 +346,7 @@ for (fname, elty) in ((@blas_suffix(:dsymv_),:Float64), m, n = size(A) if m != n throw(DimensionMismatch("Matrix A is $m by $n but must be square")) end if m != length(x) || m != length(y) throw(DimensionMismatch("")) end - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -365,8 +365,8 @@ for (fname, elty) in ((@blas_suffix(:dsymv_),:Float64), end ### hemv -for (fname, elty) in ((@blas_suffix(:zhemv_),:Complex128), - (@blas_suffix(:chemv_),:Complex64)) +for (fname, elty) in ((:zhemv_,:Complex128), + (:chemv_,:Complex64)) @eval begin function hemv!(uplo::Char, α::$elty, A::StridedMatrix{$elty}, x::StridedVector{$elty}, β::$elty, y::StridedVector{$elty}) n = size(A, 2) @@ -375,7 +375,7 @@ for (fname, elty) in ((@blas_suffix(:zhemv_),:Complex128), lda = max(1, stride(A, 2)) incx = stride(x, 1) incy = stride(y, 1) - ccall(($fname, libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -394,10 +394,10 @@ for (fname, elty) in ((@blas_suffix(:zhemv_),:Complex128), end ### sbmv, (SB) symmetric banded matrix-vector multiplication -for (fname, elty) in ((@blas_suffix(:dsbmv_),:Float64), - (@blas_suffix(:ssbmv_),:Float32), - (@blas_suffix(:zsbmv_),:Complex128), - (@blas_suffix(:csbmv_),:Complex64)) +for (fname, elty) in ((:dsbmv_,:Float64), + (:ssbmv_,:Float32), + (:zsbmv_,:Complex128), + (:csbmv_,:Complex64)) @eval begin # SUBROUTINE DSBMV(UPLO,N,K,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) # * .. Scalar Arguments .. @@ -407,7 +407,7 @@ for (fname, elty) in ((@blas_suffix(:dsbmv_),:Float64), # * .. Array Arguments .. # DOUBLE PRECISION A(LDA,*),X(*),Y(*) function sbmv!(uplo::BlasChar, k::Integer, alpha::($elty), A::StridedMatrix{$elty}, x::StridedVector{$elty}, beta::($elty), y::StridedVector{$elty}) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -427,10 +427,10 @@ for (fname, elty) in ((@blas_suffix(:dsbmv_),:Float64), end ### trmv, Triangular matrix-vector multiplication -for (fname, elty) in ((@blas_suffix(:dtrmv_),:Float64), - (@blas_suffix(:strmv_),:Float32), - (@blas_suffix(:ztrmv_),:Complex128), - (@blas_suffix(:ctrmv_),:Complex64)) +for (fname, elty) in ((:dtrmv_,:Float64), + (:strmv_,:Float32), + (:ztrmv_,:Complex128), + (:ctrmv_,:Complex64)) @eval begin # SUBROUTINE DTRMV(UPLO,TRANS,DIAG,N,A,LDA,X,INCX) # * .. Scalar Arguments .. @@ -443,7 +443,7 @@ for (fname, elty) in ((@blas_suffix(:dtrmv_),:Float64), if n != length(x) throw(DimensionMismatch("length(x)=$(length(x))does not match size(A)=$(size(A))")) end - ccall(($(string(fname)), libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &trans, &diag, &n, @@ -456,10 +456,10 @@ for (fname, elty) in ((@blas_suffix(:dtrmv_),:Float64), end end ### trsv, Triangular matrix-vector solve -for (fname, elty) in ((@blas_suffix(:dtrsv_),:Float64), - (@blas_suffix(:strsv_),:Float32), - (@blas_suffix(:ztrsv_),:Complex128), - (@blas_suffix(:ctrsv_),:Complex64)) +for (fname, elty) in ((:dtrsv_,:Float64), + (:strsv_,:Float32), + (:ztrsv_,:Complex128), + (:ctrsv_,:Complex64)) @eval begin # SUBROUTINE DTRSV(UPLO,TRANS,DIAG,N,A,LDA,X,INCX) # .. Scalar Arguments .. @@ -470,7 +470,7 @@ for (fname, elty) in ((@blas_suffix(:dtrsv_),:Float64), function trsv!(uplo::Char, trans::Char, diag::Char, A::StridedMatrix{$elty}, x::StridedVector{$elty}) n = chksquare(A) n==length(x) || throw(DimensionMismatch("size of A is $n != length(x) = $(length(x))")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &trans, &diag, &n, @@ -484,16 +484,16 @@ for (fname, elty) in ((@blas_suffix(:dtrsv_),:Float64), end ### ger -for (fname, elty) in ((@blas_suffix(:dger_),:Float64), - (@blas_suffix(:sger_),:Float32), - (@blas_suffix(:zgerc_),:Complex128), - (@blas_suffix(:cgerc_),:Complex64)) +for (fname, elty) in ((:dger_,:Float64), + (:sger_,:Float32), + (:zgerc_,:Complex128), + (:cgerc_,:Complex64)) @eval begin function ger!(α::$elty, x::StridedVector{$elty}, y::StridedVector{$elty}, A::StridedMatrix{$elty}) m, n = size(A) m == length(x) || throw(DimensionMismatch("")) n == length(y) || throw(DimensionMismatch("")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -506,15 +506,15 @@ for (fname, elty) in ((@blas_suffix(:dger_),:Float64), end ### syr -for (fname, elty) in ((@blas_suffix(:dsyr_),:Float64), - (@blas_suffix(:ssyr_),:Float32), - (@blas_suffix(:zsyr_),:Complex128), - (@blas_suffix(:csyr_),:Complex64)) +for (fname, elty) in ((:dsyr_,:Float64), + (:ssyr_,:Float32), + (:zsyr_,:Complex128), + (:csyr_,:Complex64)) @eval begin function syr!(uplo::Char, α::$elty, x::StridedVector{$elty}, A::StridedMatrix{$elty}) n = chksquare(A) length(x) == n || throw(DimensionMismatch("Length of vector must be the same as the matrix dimensions")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, &α, x, @@ -525,13 +525,13 @@ for (fname, elty) in ((@blas_suffix(:dsyr_),:Float64), end ### her -for (fname, elty) in ((@blas_suffix(:zher_),:Complex128), - (@blas_suffix(:cher_),:Complex64)) +for (fname, elty) in ((:zher_,:Complex128), + (:cher_,:Complex64)) @eval begin function her!(uplo::Char, α::$elty, x::StridedVector{$elty}, A::StridedMatrix{$elty}) n = chksquare(A) length(x) == A || throw(DimensionMismatch("Length of vector must be the same as the matrix dimensions")) - ccall(($(string(fname)), libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, &α, x, @@ -544,10 +544,10 @@ end # Level 3 ## (GE) general matrix-matrix multiplication for (gemm, elty) in - ((@blas_suffix(:dgemm_),:Float64), - (@blas_suffix(:sgemm_),:Float32), - (@blas_suffix(:zgemm_),:Complex128), - (@blas_suffix(:cgemm_),:Complex64)) + ((:dgemm_,:Float64), + (:sgemm_,:Float32), + (:zgemm_,:Complex128), + (:cgemm_,:Complex64)) @eval begin # SUBROUTINE DGEMM(TRANSA,TRANSB,M,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # * .. Scalar Arguments .. @@ -566,7 +566,7 @@ for (gemm, elty) in if m != size(C,1) || n != size(C,2) throw(DimensionMismatch("")) end - ccall(($(string(gemm)),libblas), Void, + ccall(($(blas_suffix(gemm)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -587,10 +587,10 @@ for (gemm, elty) in end ## (SY) symmetric matrix-matrix and matrix-vector multiplication -for (mfname, elty) in ((@blas_suffix(:dsymm_),:Float64), - (@blas_suffix(:ssymm_),:Float32), - (@blas_suffix(:zsymm_),:Complex128), - (@blas_suffix(:csymm_),:Complex64)) +for (mfname, elty) in ((:dsymm_,:Float64), + (:ssymm_,:Float32), + (:zsymm_,:Complex128), + (:csymm_,:Complex64)) @eval begin # SUBROUTINE DSYMM(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # .. Scalar Arguments .. @@ -603,7 +603,7 @@ for (mfname, elty) in ((@blas_suffix(:dsymm_),:Float64), m, n = size(C) j = chksquare(A) if j != (side == 'L' ? m : n) || size(B,2) != n throw(DimensionMismatch("")) end - ccall(($(string(mfname)),libblas), Void, + ccall(($(blas_suffix(mfname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -622,10 +622,10 @@ for (mfname, elty) in ((@blas_suffix(:dsymm_),:Float64), end ## syrk -for (fname, elty) in ((@blas_suffix(:dsyrk_),:Float64), - (@blas_suffix(:ssyrk_),:Float32), - (@blas_suffix(:zsyrk_),:Complex128), - (@blas_suffix(:csyrk_),:Complex64)) +for (fname, elty) in ((:dsyrk_,:Float64), + (:ssyrk_,:Float32), + (:zsyrk_,:Complex128), + (:csyrk_,:Complex64)) @eval begin # SUBROUTINE DSYRK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC) # * .. Scalar Arguments .. @@ -641,7 +641,7 @@ for (fname, elty) in ((@blas_suffix(:dsyrk_),:Float64), nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("syrk!")) end k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -659,7 +659,7 @@ function syrk(uplo::BlasChar, trans::BlasChar, alpha::Number, A::StridedVecOrMat end syrk(uplo::BlasChar, trans::BlasChar, A::StridedVecOrMat) = syrk(uplo, trans, one(eltype(A)), A) -for (fname, elty) in ((@blas_suffix(:zherk_),:Complex128), (@blas_suffix(:cherk_),:Complex64)) +for (fname, elty) in ((:zherk_,:Complex128), (:cherk_,:Complex64)) @eval begin # SUBROUTINE CHERK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC) # * .. Scalar Arguments .. @@ -674,7 +674,7 @@ for (fname, elty) in ((@blas_suffix(:zherk_),:Complex128), (@blas_suffix(:cherk_ n = chksquare(C) n == size(A, trans == 'N' ? 1 : 2) || throw(DimensionMismatch("herk!")) k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -692,10 +692,10 @@ for (fname, elty) in ((@blas_suffix(:zherk_),:Complex128), (@blas_suffix(:cherk_ end ## syr2k -for (fname, elty) in ((@blas_suffix(:dsyr2k_),:Float64), - (@blas_suffix(:ssyr2k_),:Float32), - (@blas_suffix(:zsyr2k_),:Complex128), - (@blas_suffix(:csyr2k_),:Complex64)) +for (fname, elty) in ((:dsyr2k_,:Float64), + (:ssyr2k_,:Float32), + (:zsyr2k_,:Complex128), + (:csyr2k_,:Complex64)) @eval begin # SUBROUTINE DSYR2K(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # @@ -713,7 +713,7 @@ for (fname, elty) in ((@blas_suffix(:dsyr2k_),:Float64), nn = size(A, trans == 'N' ? 1 : 2) if nn != n throw(DimensionMismatch("syr2k!")) end k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -731,7 +731,7 @@ function syr2k(uplo::BlasChar, trans::BlasChar, alpha::Number, A::StridedVecOrMa end syr2k(uplo::BlasChar, trans::BlasChar, A::StridedVecOrMat, B::StridedVecOrMat) = syr2k(uplo, trans, one(eltype(A)), A, B) -for (fname, elty1, elty2) in ((@blas_suffix(:zher2k_),:Complex128,:Float64), (@blas_suffix(:cher2k_),:Complex64,:Float32)) +for (fname, elty1, elty2) in ((:zher2k_,:Complex128,:Float64), (:cher2k_,:Complex64,:Float32)) @eval begin # SUBROUTINE CHER2K(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # @@ -749,7 +749,7 @@ for (fname, elty1, elty2) in ((@blas_suffix(:zher2k_),:Complex128,:Float64), (@b n = chksquare(C) n == size(A, trans == 'N' ? 1 : 2) || throw(DimensionMismatch("her2k!")) k = size(A, trans == 'N' ? 2 : 1) - ccall(($(string(fname)),libblas), Void, + ccall(($(blas_suffix(fname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty1}, Ptr{$elty1}, Ptr{BlasInt}, Ptr{$elty1}, Ptr{BlasInt}, Ptr{$elty2}, Ptr{$elty1}, Ptr{BlasInt}), @@ -768,10 +768,10 @@ end ## (TR) Triangular matrix and vector multiplication and solution for (mmname, smname, elty) in - ((@blas_suffix(:dtrmm_),@blas_suffix(:dtrsm_),:Float64), - (@blas_suffix(:strmm_),@blas_suffix(:strsm_),:Float32), - (@blas_suffix(:ztrmm_),@blas_suffix(:ztrsm_),:Complex128), - (@blas_suffix(:ctrmm_),@blas_suffix(:ctrsm_),:Complex64)) + ((:dtrmm_,:dtrsm_,:Float64), + (:strmm_,:strsm_,:Float32), + (:ztrmm_,:ztrsm_,:Complex128), + (:ctrmm_,:ctrsm_,:Complex64)) @eval begin # SUBROUTINE DTRMM(SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB) # * .. Scalar Arguments .. @@ -785,7 +785,7 @@ for (mmname, smname, elty) in m, n = size(B) nA = chksquare(A) if nA != (side == 'L' ? m : n) throw(DimensionMismatch("trmm!")) end - ccall(($(string(mmname)), libblas), Void, + ccall(($(blas_suffix(mmname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &side, &uplo, &transa, &diag, &m, &n, @@ -808,7 +808,7 @@ for (mmname, smname, elty) in m, n = size(B) k = chksquare(A) k==(side == 'L' ? m : n) || throw(DimensionMismatch("size of A is $n, size(B)=($m,$n) and transa='$transa'")) - ccall(($(string(smname)), libblas), Void, + ccall(($(blas_suffix(smname)), libblas), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), diff --git a/base/linalg/lapack.jl b/base/linalg/lapack.jl index e7bd80a526716..bf7cfbcb6ef59 100644 --- a/base/linalg/lapack.jl +++ b/base/linalg/lapack.jl @@ -3,7 +3,7 @@ module LAPACK const liblapack = Base.liblapack_name -import Base.@blas_suffix +import Base.blas_suffix import ..LinAlg: BlasFloat, BlasChar, BlasInt, blas_int, LAPACKException, DimensionMismatch, SingularException, PosDefException, chkstride1, chksquare @@ -32,10 +32,10 @@ end # (GB) general banded matrices, LU decomposition and solver for (gbtrf, gbtrs, elty) in - ((@blas_suffix(:dgbtrf_),@blas_suffix(:dgbtrs_),:Float64), - (@blas_suffix(:sgbtrf_),@blas_suffix(:sgbtrs_),:Float32), - (@blas_suffix(:zgbtrf_),@blas_suffix(:zgbtrs_),:Complex128), - (@blas_suffix(:cgbtrf_),@blas_suffix(:cgbtrs_),:Complex64)) + ((:dgbtrf_,:dgbtrs_,:Float64), + (:sgbtrf_,:sgbtrs_,:Float32), + (:zgbtrf_,:zgbtrs_,:Complex128), + (:cgbtrf_,:cgbtrs_,:Complex64)) @eval begin # SUBROUTINE DGBTRF( M, N, KL, KU, AB, LDAB, IPIV, INFO ) # * .. Scalar Arguments .. @@ -49,7 +49,7 @@ for (gbtrf, gbtrs, elty) in n = size(AB, 2) mnmn = min(m, n) ipiv = similar(AB, BlasInt, mnmn) - ccall(($(string(gbtrf)),liblapack), Void, + ccall(($(blas_suffix(gbtrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, &kl, &ku, AB, &max(1,stride(AB,2)), ipiv, info) @@ -70,7 +70,7 @@ for (gbtrf, gbtrs, elty) in info = Array(BlasInt, 1) n = size(AB,2) if m != n || m != size(B,1) throw(DimensionMismatch("gbtrs!")) end - ccall(($(string(gbtrs)),liblapack), Void, + ccall(($(blas_suffix(gbtrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -84,10 +84,10 @@ end ## (GE) general matrices: balancing and back-transforming for (gebal, gebak, elty, relty) in - ((@blas_suffix(:dgebal_), @blas_suffix(:dgebak_), :Float64, :Float64), - (@blas_suffix(:sgebal_), @blas_suffix(:sgebak_), :Float32, :Float32), - (@blas_suffix(:zgebal_), @blas_suffix(:zgebak_), :Complex128, :Float64), - (@blas_suffix(:cgebal_), @blas_suffix(:cgebak_), :Complex64, :Float32)) + ((:dgebal_, :dgebak_, :Float64, :Float64), + (:sgebal_, :sgebak_, :Float32, :Float32), + (:zgebal_, :zgebak_, :Complex128, :Float64), + (:cgebal_, :cgebak_, :Complex64, :Float32)) @eval begin # SUBROUTINE DGEBAL( JOB, N, A, LDA, ILO, IHI, SCALE, INFO ) #* .. Scalar Arguments .. @@ -102,7 +102,7 @@ for (gebal, gebak, elty, relty) in ihi = Array(BlasInt, 1) ilo = Array(BlasInt, 1) scale = similar(A, $relty, n) - ccall(($(string(gebal)),liblapack), Void, + ccall(($(blas_suffix(gebal)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), &job, &n, A, &max(1,stride(A,2)), ilo, ihi, scale, info) @@ -121,7 +121,7 @@ for (gebal, gebak, elty, relty) in chkstride1(V) chksquare(V) info = Array(BlasInt, 1) - ccall(($(string(gebak)),liblapack), Void, + ccall(($(blas_suffix(gebak)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &job, &side, &size(V,1), &ilo, &ihi, scale, &n, V, &max(1,stride(V,2)), info) @@ -148,10 +148,10 @@ end # updated in place. The condensed mutating functions, usually a # function of A only, are defined after this block. for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty) in - ((@blas_suffix(:dgebrd_),@blas_suffix(:dgelqf_),@blas_suffix(:dgeqlf_),@blas_suffix(:dgeqrf_),@blas_suffix(:dgeqp3_),@blas_suffix(:dgeqrt_),@blas_suffix(:dgeqrt3_),@blas_suffix(:dgerqf_),@blas_suffix(:dgetrf_),:Float64,:Float64), - (@blas_suffix(:sgebrd_),@blas_suffix(:sgelqf_),@blas_suffix(:sgeqlf_),@blas_suffix(:sgeqrf_),@blas_suffix(:sgeqp3_),@blas_suffix(:sgeqrt_),@blas_suffix(:sgeqrt3_),@blas_suffix(:sgerqf_),@blas_suffix(:sgetrf_),:Float32,:Float32), - (@blas_suffix(:zgebrd_),@blas_suffix(:zgelqf_),@blas_suffix(:zgeqlf_),@blas_suffix(:zgeqrf_),@blas_suffix(:zgeqp3_),@blas_suffix(:zgeqrt_),@blas_suffix(:zgeqrt3_),@blas_suffix(:zgerqf_),@blas_suffix(:zgetrf_),:Complex128,:Float64), - (@blas_suffix(:cgebrd_),@blas_suffix(:cgelqf_),@blas_suffix(:cgeqlf_),@blas_suffix(:cgeqrf_),@blas_suffix(:cgeqp3_),@blas_suffix(:cgeqrt_),@blas_suffix(:cgeqrt3_),@blas_suffix(:cgerqf_),@blas_suffix(:cgetrf_),:Complex64,:Float32)) + ((:dgebrd_,:dgelqf_,:dgeqlf_,:dgeqrf_,:dgeqp3_,:dgeqrt_,:dgeqrt3_,:dgerqf_,:dgetrf_,:Float64,:Float64), + (:sgebrd_,:sgelqf_,:sgeqlf_,:sgeqrf_,:sgeqp3_,:sgeqrt_,:sgeqrt3_,:sgerqf_,:sgetrf_,:Float32,:Float32), + (:zgebrd_,:zgelqf_,:zgeqlf_,:zgeqrf_,:zgeqp3_,:zgeqrt_,:zgeqrt3_,:zgerqf_,:zgetrf_,:Complex128,:Float64), + (:cgebrd_,:cgelqf_,:cgeqlf_,:cgeqrf_,:cgeqp3_,:cgeqrt_,:cgeqrt3_,:cgerqf_,:cgetrf_,:Complex64,:Float32)) @eval begin # SUBROUTINE DGEBRD( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, # INFO ) @@ -172,7 +172,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(gebrd)),liblapack), Void, + ccall(($(blas_suffix(gebrd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -200,7 +200,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) work = Array($elty, (1,)) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(gelqf)),liblapack), Void, + ccall(($(blas_suffix(gelqf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, tau, work, &lwork, info) @@ -227,7 +227,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) work = Array($elty, (1,)) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(geqlf)),liblapack), Void, + ccall(($(blas_suffix(geqlf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, tau, work, &lwork, info) @@ -258,7 +258,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty if cmplx; rwork = Array($relty, 2n); end for i in 1:2 if cmplx - ccall(($(string(geqp3)),liblapack), Void, + ccall(($(blas_suffix(geqp3)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), @@ -266,7 +266,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty jpvt, tau, work, &lwork, rwork, info) else - ccall(($(string(geqp3)),liblapack), Void, + ccall(($(blas_suffix(geqp3)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -292,7 +292,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty work = Array($elty, nb*n) if n > 0 info = Array(BlasInt, 1) - ccall(($(string(geqrt)), liblapack), Void, + ccall(($(blas_suffix(geqrt)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), @@ -310,7 +310,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty if p < n || q < n throw(DimensionMismatch("block reflector")) end if n > 0 info = Array(BlasInt, 1) - ccall(($(string(geqrt3)), liblapack), Void, + ccall(($(blas_suffix(geqrt3)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &max(1, stride(A, 2)), @@ -333,7 +333,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(geqrf)),liblapack), Void, + ccall(($(blas_suffix(geqrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &max(1,stride(A,2)), tau, work, &lwork, info) @@ -358,7 +358,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty lwork = blas_int(-1) work = Array($elty, 1) for i in 1:2 # first call returns lwork as work[1] - ccall(($(string(gerqf)),liblapack), Void, + ccall(($(blas_suffix(gerqf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &max(1,stride(A,2)), tau, work, &lwork, info) @@ -382,7 +382,7 @@ for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty m, n = size(A) lda = max(1,stride(A, 2)) ipiv = similar(A, BlasInt, min(m,n)) - ccall(($(string(getrf)),liblapack), Void, + ccall(($(blas_suffix(getrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, ipiv, info) @@ -410,10 +410,10 @@ end ## Complete orthogonaliztion tools for (tzrzf, ormrz, elty) in - ((@blas_suffix(:dtzrzf_),@blas_suffix(:dormrz_),:Float64), - (@blas_suffix(:stzrzf_),@blas_suffix(:sormrz_),:Float32), - (@blas_suffix(:ztzrzf_),@blas_suffix(:zunmrz_),:Complex128), - (@blas_suffix(:ctzrzf_),@blas_suffix(:cunmrz_),:Complex64)) + ((:dtzrzf_,:dormrz_,:Float64), + (:stzrzf_,:sormrz_,:Float32), + (:ztzrzf_,:zunmrz_,:Complex128), + (:ctzrzf_,:cunmrz_,:Complex64)) @eval begin # * SUBROUTINE ZTZRZF( M, N, A, LDA, TAU, WORK, LWORK, INFO ) # 22 * @@ -431,7 +431,7 @@ for (tzrzf, ormrz, elty) in lwork = -1 info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(tzrzf)), liblapack), Void, + ccall(($(blas_suffix(tzrzf)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, A, &lda, @@ -463,7 +463,7 @@ for (tzrzf, ormrz, elty) in lwork = -1 info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(ormrz)), liblapack), Void, + ccall(($(blas_suffix(ormrz)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -486,10 +486,10 @@ end ## (GE) general matrices, solvers with factorization, solver and inverse for (gels, gesv, getrs, getri, elty) in - ((@blas_suffix(:dgels_),@blas_suffix(:dgesv_),@blas_suffix(:dgetrs_),@blas_suffix(:dgetri_),:Float64), - (@blas_suffix(:sgels_),@blas_suffix(:sgesv_),@blas_suffix(:sgetrs_),@blas_suffix(:sgetri_),:Float32), - (@blas_suffix(:zgels_),@blas_suffix(:zgesv_),@blas_suffix(:zgetrs_),@blas_suffix(:zgetri_),:Complex128), - (@blas_suffix(:cgels_),@blas_suffix(:cgesv_),@blas_suffix(:cgetrs_),@blas_suffix(:cgetri_),:Complex64)) + ((:dgels_,:dgesv_,:dgetrs_,:dgetri_,:Float64), + (:sgels_,:sgesv_,:sgetrs_,:sgetri_,:Float32), + (:zgels_,:zgesv_,:zgetrs_,:zgetri_,:Complex128), + (:cgels_,:cgesv_,:cgetrs_,:cgetri_,:Complex64)) @eval begin # SUBROUTINE DGELS( TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK,INFO) # * .. Scalar Arguments .. @@ -504,7 +504,7 @@ for (gels, gesv, getrs, getri, elty) in work = Array($elty, 1) lwork = blas_int(-1) for i in 1:2 - ccall(($(string(gels)),liblapack), Void, + ccall(($(blas_suffix(gels)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -540,7 +540,7 @@ for (gels, gesv, getrs, getri, elty) in if size(B,1) != n throw(DimensionMismatch("gesv!")) end ipiv = similar(A, BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(gesv)),liblapack), Void, + ccall(($(blas_suffix(gesv)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -560,7 +560,7 @@ for (gels, gesv, getrs, getri, elty) in n==size(B, 1) || throw(DimensionMismatch("left and right hand sides do not fit")) nrhs = size(B, 2) info = Array(BlasInt, 1) - ccall(($(string(getrs)),liblapack), Void, + ccall(($(blas_suffix(getrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &trans, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -582,7 +582,7 @@ for (gels, gesv, getrs, getri, elty) in lwork = -1 work = Array($elty, 1) for i in 1:2 - ccall(($(string(getri)),liblapack), Void, + ccall(($(blas_suffix(getri)), liblapack), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, A, &lda, ipiv, work, &lwork, info) @@ -597,8 +597,8 @@ for (gels, gesv, getrs, getri, elty) in end end for (gesvx, elty) in - ((@blas_suffix(:dgesvx_),:Float64), - (@blas_suffix(:sgesvx_),:Float32)) + ((:dgesvx_,:Float64), + (:sgesvx_,:Float32)) @eval begin # SUBROUTINE DGESVX( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, # EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR, @@ -628,7 +628,7 @@ for (gesvx, elty) in iwork = Array($elty, n) info = Array(BlasInt, 1) X = similar(A, $elty, n, nrhs) - ccall(($(string(gesvx)),liblapack), Void, + ccall(($(blas_suffix(gesvx)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasChar}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, @@ -652,8 +652,8 @@ for (gesvx, elty) in end end for (gesvx, elty, relty) in - ((@blas_suffix(:zgesvx_),:Complex128,:Float64), - (@blas_suffix(:cgesvx_),:Complex64 ,:Float32)) + ((:zgesvx_,:Complex128,:Float64), + (:cgesvx_,:Complex64 ,:Float32)) @eval begin # SUBROUTINE ZGESVX( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, # EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR, @@ -683,7 +683,7 @@ for (gesvx, elty, relty) in rwork = Array($relty, 2n) info = Array(BlasInt, 1) x = similar(A, $elty, n, nrhs) - ccall(($(string(gesvx)),liblapack), Void, + ccall(($(blas_suffix(gesvx)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasChar}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, @@ -707,8 +707,8 @@ for (gesvx, elty, relty) in end for (gelsd, gelsy, elty) in - ((@blas_suffix(:dgelsd_),@blas_suffix(:dgelsy_),:Float64), - (@blas_suffix(:sgelsd_),@blas_suffix(:sgelsy_),:Float32)) + ((:dgelsd_,:dgelsy_,:Float64), + (:sgelsd_,:sgelsy_,:Float32)) @eval begin # SUBROUTINE DGELSD( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, # $ WORK, LWORK, IWORK, INFO ) @@ -732,7 +732,7 @@ for (gelsd, gelsy, elty) in lwork = blas_int(-1) iwork = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(gelsd)),liblapack), Void, + ccall(($(blas_suffix(gelsd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -774,7 +774,7 @@ for (gelsd, gelsy, elty) in lwork = -1 info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gelsy)), liblapack), Void, + ccall(($(blas_suffix(gelsy)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -794,8 +794,8 @@ for (gelsd, gelsy, elty) in end end for (gelsd, gelsy, elty, relty) in - ((@blas_suffix(:zgelsd_),@blas_suffix(:zgelsy_),:Complex128,:Float64), - (@blas_suffix(:cgelsd_),@blas_suffix(:cgelsy_),:Complex64,:Float32)) + ((:zgelsd_,:zgelsy_,:Complex128,:Float64), + (:cgelsd_,:cgelsy_,:Complex64,:Float32)) @eval begin # SUBROUTINE ZGELSD( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, # $ WORK, LWORK, RWORK, IWORK, INFO ) @@ -821,7 +821,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Array($relty, 1) iwork = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(gelsd)),liblapack), Void, + ccall(($(blas_suffix(gelsd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -865,7 +865,7 @@ for (gelsd, gelsy, elty, relty) in rwork = Array($relty, 2n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gelsy)), liblapack), Void, + ccall(($(blas_suffix(gelsy)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -885,10 +885,10 @@ for (gelsd, gelsy, elty, relty) in end end -for (gglse, elty) in ((@blas_suffix(:dgglse_), :Float64), - (@blas_suffix(:sgglse_), :Float32), - (@blas_suffix(:zgglse_), :Complex128), - (@blas_suffix(:cgglse_), :Complex64)) +for (gglse, elty) in ((:dgglse_, :Float64), + (:sgglse_, :Float32), + (:zgglse_, :Complex128), + (:cgglse_, :Complex64)) @eval begin # SUBROUTINE DGGLSE( M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, # $ INFO ) @@ -911,7 +911,7 @@ for (gglse, elty) in ((@blas_suffix(:dgglse_), :Float64), work = Array($elty, 1) lwork = blas_int(-1) for i in 1:2 - ccall(($(string(gglse)),liblapack), Void, + ccall(($(blas_suffix(gglse)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, @@ -931,10 +931,10 @@ end # (GE) general matrices eigenvalue-eigenvector and singular value decompositions for (geev, gesvd, gesdd, ggsvd, elty, relty) in - ((@blas_suffix(:dgeev_),@blas_suffix(:dgesvd_),@blas_suffix(:dgesdd_),@blas_suffix(:dggsvd_),:Float64,:Float64), - (@blas_suffix(:sgeev_),@blas_suffix(:sgesvd_),@blas_suffix(:sgesdd_),@blas_suffix(:sggsvd_),:Float32,:Float32), - (@blas_suffix(:zgeev_),@blas_suffix(:zgesvd_),@blas_suffix(:zgesdd_),@blas_suffix(:zggsvd_),:Complex128,:Float64), - (@blas_suffix(:cgeev_),@blas_suffix(:cgesvd_),@blas_suffix(:cgesdd_),@blas_suffix(:cggsvd_),:Complex64,:Float32)) + ((:dgeev_,:dgesvd_,:dgesdd_,:dggsvd_,:Float64,:Float64), + (:sgeev_,:sgesvd_,:sgesdd_,:sggsvd_,:Float32,:Float32), + (:zgeev_,:zgesvd_,:zgesdd_,:zggsvd_,:Complex128,:Float64), + (:cgeev_,:cgesvd_,:cgesdd_,:cggsvd_,:Complex64,:Float32)) @eval begin # SUBROUTINE DGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, # $ LDVR, WORK, LWORK, INFO ) @@ -964,7 +964,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Array(BlasInt, 1) for i = 1:2 if cmplx - ccall(($(string(geev)),liblapack), Void, + ccall(($(blas_suffix(geev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -972,7 +972,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in &jobvl, &jobvr, &n, A, &max(1,stride(A,2)), W, VL, &n, VR, &n, work, &lwork, rwork, info) else - ccall(($(string(geev)),liblapack), Void, + ccall(($(blas_suffix(geev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1027,7 +1027,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Array(BlasInt, 1) for i = 1:2 if cmplx - ccall(($(string(gesdd)),liblapack), Void, + ccall(($(blas_suffix(gesdd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1035,7 +1035,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in &job, &m, &n, A, &max(1,stride(A,2)), S, U, &max(1,stride(U,2)), VT, &max(1,stride(VT,2)), work, &lwork, rwork, iwork, info) else - ccall(($(string(gesdd)),liblapack), Void, + ccall(($(blas_suffix(gesdd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1072,7 +1072,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in info = Array(BlasInt, 1) for i in 1:2 if cmplx - ccall(($(string(gesvd)),liblapack), Void, + ccall(($(blas_suffix(gesvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1080,7 +1080,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in &jobu, &jobvt, &m, &n, A, &max(1,stride(A,2)), S, U, &max(1,stride(U,2)), VT, &max(1,stride(VT,2)), work, &lwork, rwork, info) else - ccall(($(string(gesvd)),liblapack), Void, + ccall(($(blas_suffix(gesvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1131,7 +1131,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in iwork = Array(BlasInt, n) info = Array(BlasInt, 1) if cmplx - ccall(($(string(ggsvd)),liblapack), Void, + ccall(($(blas_suffix(ggsvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1145,7 +1145,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in V, &ldv, Q, &ldq, work, rwork, iwork, info) else - ccall(($(string(ggsvd)),liblapack), Void, + ccall(($(blas_suffix(ggsvd)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1171,8 +1171,8 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in end ## Expert driver and generalized eigenvlua problem for (geevx, ggev, elty) in - ((@blas_suffix(:dgeevx_),@blas_suffix(:dggev_),:Float64), - (@blas_suffix(:sgeevx_),@blas_suffix(:sggev_),:Float32)) + ((:dgeevx_,:dggev_,:Float64), + (:sgeevx_,:sggev_,:Float32)) @eval begin # SUBROUTINE DGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI, # VL, LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, @@ -1208,7 +1208,7 @@ for (geevx, ggev, elty) in iwork = Array(BlasInt, sense == 'N' || sense == 'E' ? 0 : (sense == 'V' || sense == 'B' ? 2n-2 : throw(ArgumentError("argument sense must be 'N', 'E', 'V' or 'B'")))) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(geevx)),Base.liblapack_name), Void, + ccall(($(blas_suffix(geevx)), liblapack), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1255,7 +1255,7 @@ for (geevx, ggev, elty) in lwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(ggev)), liblapack), Void, + ccall(($(blas_suffix(ggev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, @@ -1277,8 +1277,8 @@ for (geevx, ggev, elty) in end end for (geevx, ggev, elty, relty) in - ((@blas_suffix(:zgeevx_),@blas_suffix(:zggev_),:Complex128,:Float64), - (@blas_suffix(:cgeevx_),@blas_suffix(:cggev_),:Complex64,:Float32)) + ((:zgeevx_,:zggev_,:Complex128,:Float64), + (:cgeevx_,:cggev_,:Complex64,:Float32)) @eval begin # SUBROUTINE ZGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, # LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, @@ -1313,7 +1313,7 @@ for (geevx, ggev, elty, relty) in rwork = Array($relty, 2n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(geevx)),Base.liblapack_name), Void, + ccall(($(blas_suffix(geevx)), liblapack), Void, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1360,7 +1360,7 @@ for (geevx, ggev, elty, relty) in rwork = Array($relty, 8n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(ggev)), liblapack), Void, + ccall(($(blas_suffix(ggev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -1384,8 +1384,8 @@ end # One step incremental condition estimation of max/min singular values for (laic1, elty) in - ((@blas_suffix(:dlaic1_),:Float64), - (@blas_suffix(:slaic1_),:Float32)) + ((:dlaic1_,:Float64), + (:slaic1_,:Float32)) @eval begin # 21 * SUBROUTINE DLAIC1( JOB, J, X, SEST, W, GAMMA, SESTPR, S, C ) # 22 * @@ -1401,7 +1401,7 @@ for (laic1, elty) in sestpr = Array($elty, 1) s = Array($elty, 1) c = Array($elty, 1) - ccall(($(string(laic1)), liblapack), Void, + ccall(($(blas_suffix(laic1)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}), @@ -1413,8 +1413,8 @@ for (laic1, elty) in end end for (laic1, elty, relty) in - ((@blas_suffix(:zlaic1_),:Complex128,:Float64), - (@blas_suffix(:claic1_),:Complex64,:Float32)) + ((:zlaic1_,:Complex128,:Float64), + (:claic1_,:Complex64,:Float32)) @eval begin # 21 * SUBROUTINE ZLAIC1( JOB, J, X, SEST, W, GAMMA, SESTPR, S, C ) # 22 * @@ -1431,7 +1431,7 @@ for (laic1, elty, relty) in sestpr = Array($relty, 1) s = Array($elty, 1) c = Array($elty, 1) - ccall(($(string(laic1)), liblapack), Void, + ccall(($(blas_suffix(laic1)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}), @@ -1446,10 +1446,10 @@ end # (GT) General tridiagonal, decomposition, solver and direct solver for (gtsv, gttrf, gttrs, elty) in - ((@blas_suffix(:dgtsv_),@blas_suffix(:dgttrf_),@blas_suffix(:dgttrs_),:Float64), - (@blas_suffix(:sgtsv_),@blas_suffix(:sgttrf_),@blas_suffix(:sgttrs_),:Float32), - (@blas_suffix(:zgtsv_),@blas_suffix(:zgttrf_),@blas_suffix(:zgttrs_),:Complex128), - (@blas_suffix(:cgtsv_),@blas_suffix(:cgttrf_),@blas_suffix(:cgttrs_),:Complex64)) + ((:dgtsv_,:dgttrf_,:dgttrs_,:Float64), + (:sgtsv_,:sgttrf_,:sgttrs_,:Float32), + (:zgtsv_,:zgttrf_,:zgttrs_,:Complex128), + (:cgtsv_,:cgttrf_,:cgttrs_,:Complex64)) @eval begin # SUBROUTINE DGTSV( N, NRHS, DL, D, DU, B, LDB, INFO ) # .. Scalar Arguments .. @@ -1464,7 +1464,7 @@ for (gtsv, gttrf, gttrs, elty) in n == size(B,1) || throw(DimensionMismatch("right hand side has wrong number of rows")) n == 0 && return B # Early exit if possible info = Array(BlasInt, 1) - ccall(($(string(gtsv)),liblapack), Void, + ccall(($(blas_suffix(gtsv)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), dl, d, du, B, &max(1,stride(B,2)), info) @@ -1485,7 +1485,7 @@ for (gtsv, gttrf, gttrs, elty) in du2 = similar(d, $elty, n-2) ipiv = similar(d, BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(gttrf)),liblapack), Void, + ccall(($(blas_suffix(gttrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, dl, d, du, du2, ipiv, info) @@ -1507,7 +1507,7 @@ for (gtsv, gttrf, gttrs, elty) in if length(dl) != n - 1 || length(du) != n - 1 throw(DimensionMismatch("gttrs!")) end if n != size(B,1) throw(DimensionMismatch("gttrs!")) end info = Array(BlasInt, 1) - ccall(($(string(gttrs)),liblapack), Void, + ccall(($(blas_suffix(gttrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -1520,10 +1520,10 @@ end ## (OR) orthogonal (or UN, unitary) matrices, extractors and multiplication for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in - ((@blas_suffix(:dorglq_),@blas_suffix(:dorgqr_),@blas_suffix(:dormlq_),@blas_suffix(:dormqr_),@blas_suffix(:dgemqrt_),:Float64), - (@blas_suffix(:sorglq_),@blas_suffix(:sorgqr_),@blas_suffix(:sormlq_),@blas_suffix(:sormqr_),@blas_suffix(:sgemqrt_),:Float32), - (@blas_suffix(:zunglq_),@blas_suffix(:zungqr_),@blas_suffix(:zunmlq_),@blas_suffix(:zunmqr_),@blas_suffix(:zgemqrt_),:Complex128), - (@blas_suffix(:cunglq_),@blas_suffix(:cungqr_),@blas_suffix(:cunmlq_),@blas_suffix(:cunmqr_),@blas_suffix(:cgemqrt_),:Complex64)) + ((:dorglq_,:dorgqr_,:dormlq_,:dormqr_,:dgemqrt_,:Float64), + (:sorglq_,:sorgqr_,:sormlq_,:sormqr_,:sgemqrt_,:Float32), + (:zunglq_,:zungqr_,:zunmlq_,:zunmqr_,:zgemqrt_,:Complex128), + (:cunglq_,:cungqr_,:cunmlq_,:cunmqr_,:cgemqrt_,:Complex64)) @eval begin # SUBROUTINE DORGLQ( M, N, K, A, LDA, TAU, WORK, LWORK, INFO ) # * .. Scalar Arguments .. @@ -1539,7 +1539,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(orglq)),liblapack), Void, + ccall(($(blas_suffix(orglq)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, &k, A, &max(1,stride(A,2)), tau, work, &lwork, info) @@ -1569,7 +1569,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(orgqr)),liblapack), Void, + ccall(($(blas_suffix(orgqr)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &m, &n, &k, A, @@ -1607,7 +1607,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(ormlq)),liblapack), Void, + ccall(($(blas_suffix(ormlq)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -1641,7 +1641,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(ormqr)),liblapack), Void, + ccall(($(blas_suffix(ormqr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1680,7 +1680,7 @@ for (orglq, orgqr, ormlq, ormqr, gemqrt, elty) in ldc = max(1, stride(C,2)) work = Array($elty, wss) info = Array(BlasInt, 1) - ccall(($(string(gemqrt)), liblapack), Void, + ccall(($(blas_suffix(gemqrt)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -1698,10 +1698,10 @@ end # (PO) positive-definite symmetric matrices, # Cholesky decomposition, solvers (direct and factored) and inverse. for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in - ((@blas_suffix(:dposv_),@blas_suffix(:dpotrf_),@blas_suffix(:dpotri_),@blas_suffix(:dpotrs_),@blas_suffix(:dpstrf_),:Float64,:Float64), - (@blas_suffix(:sposv_),@blas_suffix(:spotrf_),@blas_suffix(:spotri_),@blas_suffix(:spotrs_),@blas_suffix(:spstrf_),:Float32,:Float32), - (@blas_suffix(:zposv_),@blas_suffix(:zpotrf_),@blas_suffix(:zpotri_),@blas_suffix(:zpotrs_),@blas_suffix(:zpstrf_),:Complex128,:Float64), - (@blas_suffix(:cposv_),@blas_suffix(:cpotrf_),@blas_suffix(:cpotri_),@blas_suffix(:cpotrs_),@blas_suffix(:cpstrf_),:Complex64,:Float32)) + ((:dposv_,:dpotrf_,:dpotri_,:dpotrs_,:dpstrf_,:Float64,:Float64), + (:sposv_,:spotrf_,:spotri_,:spotrs_,:spstrf_,:Float32,:Float32), + (:zposv_,:zpotrf_,:zpotri_,:zpotrs_,:zpstrf_,:Complex128,:Float64), + (:cposv_,:cpotrf_,:cpotri_,:cpotrs_,:cpstrf_,:Complex64,:Float32)) @eval begin # SUBROUTINE DPOSV( UPLO, N, NRHS, A, LDA, B, LDB, INFO ) #* .. Scalar Arguments .. @@ -1715,7 +1715,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in @chkuplo if size(B,1) != n throw(DimensionMismatch("posv!")) end info = Array(BlasInt, 1) - ccall(($(string(posv)),liblapack), Void, + ccall(($(blas_suffix(posv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), B, &max(1,stride(B,2)), info) @@ -1736,7 +1736,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in lda = max(1,stride(A,2)) lda==0 && return A, 0 info = Array(BlasInt, 1) - ccall(($(string(potrf)),liblapack), Void, + ccall(($(blas_suffix(potrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &size(A,1), A, &lda, info) @assertargsok @@ -1755,7 +1755,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in chkstride1(A) @chkuplo info = Array(BlasInt, 1) - ccall(($(string(potri)),liblapack), Void, + ccall(($(blas_suffix(potri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &size(A,1), A, &max(1,stride(A,2)), info) @assertargsok @@ -1778,7 +1778,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in if lda == 0 || nrhs == 0 return B end ldb = max(1,stride(B,2)) info = Array(BlasInt, 1) - ccall(($(string(potrs)),liblapack), Void, + ccall(($(blas_suffix(potrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &nrhs, A, @@ -1802,7 +1802,7 @@ for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in rank = Array(BlasInt, 1) work = Array($rtyp, 2n) info = Array(BlasInt, 1) - ccall(($(string(pstrf)),liblapack), Void, + ccall(($(blas_suffix(pstrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$rtyp}, Ptr{$rtyp}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), piv, rank, &tol, work, info) @@ -1815,10 +1815,10 @@ end ## (PT) positive-definite, symmetric, tri-diagonal matrices ## Direct solvers for general tridiagonal and symmetric positive-definite tridiagonal for (ptsv, pttrf, pttrs, elty, relty) in - ((@blas_suffix(:dptsv_),@blas_suffix(:dpttrf_),@blas_suffix(:dpttrs_),:Float64,:Float64), - (@blas_suffix(:sptsv_),@blas_suffix(:spttrf_),@blas_suffix(:spttrs_),:Float32,:Float32), - (@blas_suffix(:zptsv_),@blas_suffix(:zpttrf_),@blas_suffix(:zpttrs_),:Complex128,:Float64), - (@blas_suffix(:cptsv_),@blas_suffix(:cpttrf_),@blas_suffix(:cpttrs_),:Complex64,:Float32)) + ((:dptsv_,:dpttrf_,:dpttrs_,:Float64,:Float64), + (:sptsv_,:spttrf_,:spttrs_,:Float32,:Float32), + (:zptsv_,:zpttrf_,:zpttrs_,:Complex128,:Float64), + (:cptsv_,:cpttrf_,:cpttrs_,:Complex64,:Float32)) @eval begin # SUBROUTINE DPTSV( N, NRHS, D, E, B, LDB, INFO ) # .. Scalar Arguments .. @@ -1830,7 +1830,7 @@ for (ptsv, pttrf, pttrs, elty, relty) in n = length(D) if length(E) != n - 1 || n != size(B,1) throw(DimensionMismatch("ptsv!")) end info = Array(BlasInt, 1) - ccall(($(string(ptsv)),liblapack), Void, + ccall(($(blas_suffix(ptsv)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), D, E, B, &max(1,stride(B,2)), info) @@ -1846,7 +1846,7 @@ for (ptsv, pttrf, pttrs, elty, relty) in n = length(D) if length(E) != (n-1) throw(DimensionMismatch("pttrf!")) end info = Array(BlasInt, 1) - ccall(($(string(pttrf)),liblapack), Void, + ccall(($(blas_suffix(pttrf)), liblapack), Void, (Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}), &n, D, E, info) @lapackerror @@ -1855,8 +1855,8 @@ for (ptsv, pttrf, pttrs, elty, relty) in end end for (pttrs, elty, relty) in - ((@blas_suffix(:dpttrs_),:Float64,:Float64), - (@blas_suffix(:spttrs_),:Float32,:Float32)) + ((:dpttrs_,:Float64,:Float64), + (:spttrs_,:Float32,:Float32)) @eval begin # SUBROUTINE DPTTRS( N, NRHS, D, E, B, LDB, INFO ) # .. Scalar Arguments .. @@ -1868,7 +1868,7 @@ for (pttrs, elty, relty) in n = length(D) if length(E) != (n-1) || size(B,1) != n throw(DimensionMismatch("pttrs!")) end info = Array(BlasInt, 1) - ccall(($(string(pttrs)),liblapack), Void, + ccall(($(blas_suffix(pttrs)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &n, &size(B,2), D, E, B, &max(1,stride(B,2)), info) @@ -1878,8 +1878,8 @@ for (pttrs, elty, relty) in end end for (pttrs, elty, relty) in - ((@blas_suffix(:zpttrs_),:Complex128,:Float64), - (@blas_suffix(:cpttrs_),:Complex64,:Float32)) + ((:zpttrs_,:Complex128,:Float64), + (:cpttrs_,:Complex64,:Float32)) @eval begin # SUBROUTINE ZPTTRS( UPLO, N, NRHS, D, E, B, LDB, INFO ) # * .. Scalar Arguments .. @@ -1895,7 +1895,7 @@ for (pttrs, elty, relty) in n = length(D) if length(E) != (n-1) || size(B,1) != n throw(DimensionMismatch("pttrs!")) end info = Array(BlasInt, 1) - ccall(($(string(pttrs)),liblapack), Void, + ccall(($(blas_suffix(pttrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), D, E, B, &max(1,stride(B,2)), info) @@ -1907,10 +1907,10 @@ end ## (TR) triangular matrices: solver and inverse for (trtri, trtrs, elty) in - ((@blas_suffix(:dtrtri_),@blas_suffix(:dtrtrs_),:Float64), - (@blas_suffix(:strtri_),@blas_suffix(:strtrs_),:Float32), - (@blas_suffix(:ztrtri_),@blas_suffix(:ztrtrs_),:Complex128), - (@blas_suffix(:ctrtri_),@blas_suffix(:ctrtrs_),:Complex64)) + ((:dtrtri_,:dtrtrs_,:Float64), + (:strtri_,:strtrs_,:Float32), + (:ztrtri_,:ztrtrs_,:Complex128), + (:ctrtri_,:ctrtrs_,:Complex64)) @eval begin # SUBROUTINE DTRTRI( UPLO, DIAG, N, A, LDA, INFO ) #* .. Scalar Arguments .. @@ -1924,7 +1924,7 @@ for (trtri, trtrs, elty) in @chkuplo lda = max(1,stride(A, 2)) info = Array(BlasInt, 1) - ccall(($(string(trtri)),liblapack), Void, + ccall(($(blas_suffix(trtri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &diag, &n, A, &lda, info) @@ -1944,7 +1944,7 @@ for (trtri, trtrs, elty) in @chkuplo size(B,1)==n || throw(DimensionMismatch("")) info = Array(BlasInt, 1) - ccall(($(string(trtrs)),liblapack), Void, + ccall(($(blas_suffix(trtrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &trans, &diag, &n, &size(B,2), A, &max(1,stride(A,2)), @@ -1957,8 +1957,8 @@ end #Eigenvector computation and condition number estimation for (trcon, trevc, trrfs, elty) in - ((@blas_suffix(:dtrcon_),@blas_suffix(:dtrevc_),@blas_suffix(:dtrrfs_),:Float64), - (@blas_suffix(:strcon_),@blas_suffix(:strevc_),@blas_suffix(:strrfs_),:Float32)) + ((:dtrcon_,:dtrevc_,:dtrrfs_,:Float64), + (:strcon_,:strevc_,:strrfs_,:Float32)) @eval begin #SUBROUTINE DTRCON( NORM, UPLO, DIAG, N, A, LDA, RCOND, WORK, # IWORK, INFO ) @@ -1978,7 +1978,7 @@ for (trcon, trevc, trrfs, elty) in work = Array($elty, 3n) iwork = Array(BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(trcon)),liblapack), Void, + ccall(($(blas_suffix(trcon)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &norm, &uplo, &diag, &n, @@ -2011,7 +2011,7 @@ for (trcon, trevc, trrfs, elty) in work = Array($elty, 3n) info = Array(BlasInt, 1) - ccall(($(string(trevc)),liblapack), Void, + ccall(($(blas_suffix(trevc)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt},Ptr{BlasInt}, Ptr{BlasInt}, @@ -2060,7 +2060,7 @@ for (trcon, trevc, trrfs, elty) in work = Array($elty, 3n) iwork = Array(BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(trrfs)),liblapack), Void, + ccall(($(blas_suffix(trrfs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -2073,8 +2073,8 @@ for (trcon, trevc, trrfs, elty) in end end for (trcon, trevc, trrfs, elty, relty) in - ((@blas_suffix(:ztrcon_),@blas_suffix(:ztrevc_),@blas_suffix(:ztrrfs_),:Complex128,:Float64), - (@blas_suffix(:ctrcon_),@blas_suffix(:ctrevc_),@blas_suffix(:ctrrfs_),:Complex64, :Float32)) + ((:ztrcon_,:ztrevc_,:ztrrfs_,:Complex128,:Float64), + (:ctrcon_,:ctrevc_,:ctrrfs_,:Complex64, :Float32)) @eval begin #SUBROUTINE ZTRCON( NORM, UPLO, DIAG, N, A, LDA, RCOND, WORK, # RWORK, INFO ) @@ -2094,7 +2094,7 @@ for (trcon, trevc, trrfs, elty, relty) in work = Array($elty, 2n) rwork = Array($relty, n) info = Array(BlasInt, 1) - ccall(($(string(trcon)),liblapack), Void, + ccall(($(blas_suffix(trcon)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), &norm, &uplo, &diag, &n, @@ -2130,7 +2130,7 @@ for (trcon, trevc, trrfs, elty, relty) in rwork = Array($relty, n) info = Array(BlasInt, 1) - ccall(($(string(trevc)),liblapack), Void, + ccall(($(blas_suffix(trevc)), liblapack), Void, (Ptr{Char}, Ptr{Char}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2179,7 +2179,7 @@ for (trcon, trevc, trrfs, elty, relty) in work=Array($elty, 2n) rwork=Array($relty, n) info=Array(BlasInt, 1) - ccall(($(string(trrfs)),liblapack), Void, + ccall(($(blas_suffix(trrfs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), @@ -2194,10 +2194,10 @@ end ## (ST) Symmetric tridiagonal - eigendecomposition for (stev, stebz, stegr, stein, elty) in - ((@blas_suffix(:dstev_),@blas_suffix(:dstebz_),@blas_suffix(:dstegr_),@blas_suffix(:dstein_),:Float64), - (@blas_suffix(:sstev_),@blas_suffix(:sstebz_),@blas_suffix(:sstegr_),@blas_suffix(:sstein_),:Float32) -# , (@blas_suffix(:zstev_),:Complex128) Need to rewrite for ZHEEV, rwork, etc. -# , (@blas_suffix(:cstev_),:Complex64) + ((:dstev_,:dstebz_,:dstegr_,:dstein_,:Float64), + (:sstev_,:sstebz_,:sstegr_,:sstein_,:Float32) +# , (:zstev_,:Complex128) Need to rewrite for ZHEEV, rwork, etc. +# , (:cstev_,:Complex64) ) @eval begin #* DSTEV computes all eigenvalues and, optionally, eigenvectors of a @@ -2208,7 +2208,7 @@ for (stev, stebz, stegr, stein, elty) in Zmat = similar(dv, $elty, (n, job != 'N' ? n : 0)) work = Array($elty, max(1, 2n-2)) info = Array(BlasInt, 1) - ccall(($(string(stev)),liblapack), Void, + ccall(($(blas_suffix(stev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &job, &n, dv, ev, Zmat, &n, work, info) @@ -2231,7 +2231,7 @@ for (stev, stebz, stegr, stein, elty) in work = Array($elty, 4*n) iwork = Array(BlasInt,3*n) info = Array(BlasInt, 1) - ccall(($(string(stebz)),liblapack), Void, + ccall(($(blas_suffix(stebz)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2269,7 +2269,7 @@ for (stev, stebz, stegr, stein, elty) in liwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(stegr)), liblapack), Void, + ccall(($(blas_suffix(stegr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -2328,7 +2328,7 @@ for (stev, stebz, stegr, stein, elty) in ifail = Array(BlasInt,m) info = Array(BlasInt,1) - ccall(($(string(stein)),liblapack), Void, + ccall(($(blas_suffix(stein)), liblapack), Void, (Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2351,8 +2351,8 @@ stein!(dv::Vector, ev::Vector, eval::Real)=stein!(dv, ev, [eval], zeros(BlasInt, ## (SY) symmetric real matrices - Bunch-Kaufman decomposition, ## solvers (direct and factored) and inverse. for (syconv, sysv, sytrf, sytri, sytrs, elty) in - ((@blas_suffix(:dsyconv_),@blas_suffix(:dsysv_),@blas_suffix(:dsytrf_),@blas_suffix(:dsytri_),@blas_suffix(:dsytrs_),:Float64), - (@blas_suffix(:ssyconv_),@blas_suffix(:ssysv_),@blas_suffix(:ssytrf_),@blas_suffix(:ssytri_),@blas_suffix(:ssytrs_),:Float32)) + ((:dsyconv_,:dsysv_,:dsytrf_,:dsytri_,:dsytrs_,:Float64), + (:ssyconv_,:ssysv_,:ssytrf_,:ssytri_,:ssytrs_,:Float32)) @eval begin # SUBROUTINE DSYCONV( UPLO, WAY, N, A, LDA, IPIV, WORK, INFO ) # * .. Scalar Arguments .. @@ -2367,7 +2367,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(syconv)),liblapack), Void, + ccall(($(blas_suffix(syconv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &'C', &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2392,7 +2392,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sysv)),liblapack), Void, + ccall(($(blas_suffix(sysv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), @@ -2423,7 +2423,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sytrf)),liblapack), Void, + ccall(($(blas_suffix(sytrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, A, &stride(A,2), ipiv, work, &lwork, info) @@ -2451,7 +2451,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in # lwork = blas_int(-1) # info = Array(BlasInt, 1) # for i in 1:2 -# ccall(($(string(sytri)),liblapack), Void, +# ccall(($(blas_suffix(sytri)), liblapack), Void, # (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2477,7 +2477,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(sytri)),liblapack), Void, + ccall(($(blas_suffix(sytri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2500,7 +2500,7 @@ for (syconv, sysv, sytrf, sytri, sytrs, elty) in @chkuplo if n != size(B,1) throw(DimensionMismatch("sytrs!")) end info = Array(BlasInt, 1) - ccall(($(string(sytrs)),liblapack), Void, + ccall(($(blas_suffix(sytrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -2512,8 +2512,8 @@ end ## (SY) hermitian matrices - eigendecomposition, Bunch-Kaufman decomposition, ## solvers (direct and factored) and inverse. for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in - ((@blas_suffix(:zsyconv_),@blas_suffix(:zhesv_),@blas_suffix(:zhetrf_),@blas_suffix(:zhetri_),@blas_suffix(:zhetrs_),:Complex128, :Float64), - (@blas_suffix(:csyconv_),@blas_suffix(:chesv_),@blas_suffix(:chetrf_),@blas_suffix(:chetri_),@blas_suffix(:chetrs_),:Complex64, :Float32)) + ((:zsyconv_,:zhesv_,:zhetrf_,:zhetri_,:zhetrs_,:Complex128, :Float64), + (:csyconv_,:chesv_,:chetrf_,:chetri_,:chetrs_,:Complex64, :Float32)) @eval begin # SUBROUTINE ZSYCONV( UPLO, WAY, N, A, LDA, IPIV, WORK, INFO ) # 22 * @@ -2530,7 +2530,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(syconv)),liblapack), Void, + ccall(($(blas_suffix(syconv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &'C', &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2555,7 +2555,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(hesv)),liblapack), Void, + ccall(($(blas_suffix(hesv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), @@ -2585,7 +2585,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(hetrf)),liblapack), Void, + ccall(($(blas_suffix(hetrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2614,7 +2614,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in # lwork = blas_int(-1) # info = Array(BlasInt, 1) # for i in 1:2 -# ccall(($(string(hetri)),liblapack), Void, +# ccall(($(blas_suffix(hetri)), liblapack), Void, # (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2640,7 +2640,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(hetri)),liblapack), Void, + ccall(($(blas_suffix(hetri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2661,7 +2661,7 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in n = chksquare(A) if n != size(B,1) throw(DimensionMismatch("hetrs!")) end info = Array(BlasInt, 1) - ccall(($(string(hetrs)),liblapack), Void, + ccall(($(blas_suffix(hetrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -2671,8 +2671,8 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in end end for (sysv, sytrf, sytri, sytrs, elty, relty) in - ((@blas_suffix(:zsysv_),@blas_suffix(:zsytrf_),@blas_suffix(:zsytri_),@blas_suffix(:zsytrs_),:Complex128, :Float64), - (@blas_suffix(:csysv_),@blas_suffix(:csytrf_),@blas_suffix(:csytri_),@blas_suffix(:csytrs_),:Complex64, :Float32)) + ((:zsysv_,:zsytrf_,:zsytri_,:zsytrs_,:Complex128, :Float64), + (:csysv_,:csytrf_,:csytri_,:csytrs_,:Complex64, :Float32)) @eval begin # SUBROUTINE ZSYSV( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, # $ LWORK, INFO ) @@ -2693,7 +2693,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sysv)),liblapack), Void, + ccall(($(blas_suffix(sysv)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), @@ -2724,7 +2724,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(sytrf)),liblapack), Void, + ccall(($(blas_suffix(sytrf)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2753,7 +2753,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in # lwork = blas_int(-1) # info = Array(BlasInt, 1) # for i in 1:2 -# ccall(($(string(sytri)),liblapack), Void, +# ccall(($(blas_suffix(sytri)), liblapack), Void, # (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, # Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), # &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, &lwork, info) @@ -2779,7 +2779,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in @chkuplo work = Array($elty, n) info = Array(BlasInt, 1) - ccall(($(string(sytri)),liblapack), Void, + ccall(($(blas_suffix(sytri)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &uplo, &n, A, &max(1,stride(A,2)), ipiv, work, info) @@ -2801,7 +2801,7 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in @chkuplo if n != size(B,1) throw(DimensionMismatch("sytrs!")) end info = Array(BlasInt, 1) - ccall(($(string(sytrs)),liblapack), Void, + ccall(($(blas_suffix(sytrs)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &uplo, &n, &size(B,2), A, &max(1,stride(A,2)), ipiv, B, &max(1,stride(B,2)), info) @@ -2813,8 +2813,8 @@ end # Symmetric (real) eigensolvers for (syev, syevr, sygvd, elty) in - ((@blas_suffix(:dsyev_),@blas_suffix(:dsyevr_),@blas_suffix(:dsygvd_),:Float64), - (@blas_suffix(:ssyev_),@blas_suffix(:ssyevr_),@blas_suffix(:ssygvd_),:Float32)) + ((:dsyev_,:dsyevr_,:dsygvd_,:Float64), + (:ssyev_,:ssyevr_,:ssygvd_,:Float32)) @eval begin # SUBROUTINE DSYEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO ) # * .. Scalar Arguments .. @@ -2830,7 +2830,7 @@ for (syev, syevr, sygvd, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syev)),liblapack), Void, + ccall(($(blas_suffix(syev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &jobz, &uplo, &n, A, &max(1,stride(A,2)), W, work, &lwork, info) @@ -2879,7 +2879,7 @@ for (syev, syevr, sygvd, elty) in liwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syevr)),liblapack), Void, + ccall(($(blas_suffix(syevr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -2925,7 +2925,7 @@ for (syev, syevr, sygvd, elty) in liwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(sygvd)),liblapack), Void, + ccall(($(blas_suffix(sygvd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, @@ -2949,8 +2949,8 @@ for (syev, syevr, sygvd, elty) in end # Hermitian eigensolvers for (syev, syevr, sygvd, elty, relty) in - ((@blas_suffix(:zheev_),@blas_suffix(:zheevr_),@blas_suffix(:zhegvd_),:Complex128,:Float64), - (@blas_suffix(:cheev_),@blas_suffix(:cheevr_),@blas_suffix(:chegvd_),:Complex64,:Float32)) + ((:zheev_,:zheevr_,:zhegvd_,:Complex128,:Float64), + (:cheev_,:cheevr_,:chegvd_,:Complex64,:Float32)) @eval begin # SUBROUTINE ZHEEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, INFO ) # * .. Scalar Arguments .. @@ -2969,7 +2969,7 @@ for (syev, syevr, sygvd, elty, relty) in rwork = Array($relty, max(1, 3n-2)) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syev)),liblapack), Void, + ccall(($(blas_suffix(syev)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), &jobz, &uplo, &n, A, &stride(A,2), W, work, &lwork, rwork, info) @@ -3022,7 +3022,7 @@ for (syev, syevr, sygvd, elty, relty) in liwork = blas_int(-1) info = Array(BlasInt, 1) for i in 1:2 - ccall(($(string(syevr)),liblapack), Void, + ccall(($(blas_suffix(syevr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -3078,7 +3078,7 @@ for (syev, syevr, sygvd, elty, relty) in lrwork = -one(BlasInt) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(sygvd)),liblapack), Void, + ccall(($(blas_suffix(sygvd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, @@ -3105,10 +3105,10 @@ end ## (BD) Bidiagonal matrices - singular value decomposition for (bdsqr, relty, elty) in - ((@blas_suffix(:dbdsqr_),:Float64,:Float64), - (@blas_suffix(:sbdsqr_),:Float32,:Float32), - (@blas_suffix(:zbdsqr_),:Float64,:Complex128), - (@blas_suffix(:cbdsqr_),:Float32,:Complex64)) + ((:dbdsqr_,:Float64,:Float64), + (:sbdsqr_,:Float32,:Float32), + (:zbdsqr_,:Float64,:Complex128), + (:cbdsqr_,:Float32,:Complex64)) @eval begin #*> DBDSQR computes the singular values and, optionally, the right and/or #*> left singular vectors from the singular value decomposition (SVD) of @@ -3138,7 +3138,7 @@ for (bdsqr, relty, elty) in work = Array($elty, 4n) info = Array(BlasInt,1) - ccall(($(string(bdsqr)),liblapack), Void, + ccall(($(blas_suffix(bdsqr)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3156,8 +3156,8 @@ end #Defined only for real types for (bdsdc, elty) in - ((@blas_suffix(:dbdsdc_),:Float64), - (@blas_suffix(:sbdsdc_),:Float32)) + ((:dbdsdc_,:Float64), + (:sbdsdc_,:Float32)) @eval begin #* DBDSDC computes the singular value decomposition (SVD) of a real #* N-by-N (upper or lower) bidiagonal matrix B: B = U * S * VT, @@ -3196,7 +3196,7 @@ for (bdsdc, elty) in work =Array($elty, lwork) iwork=Array(BlasInt, 8n) info =Array(BlasInt, 1) - ccall(($(string(bdsdc)),liblapack), Void, + ccall(($(blas_suffix(bdsdc)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3212,8 +3212,8 @@ end # Estimate condition number for (gecon, elty) in - ((@blas_suffix(:dgecon_),:Float64), - (@blas_suffix(:sgecon_),:Float32)) + ((:dgecon_,:Float64), + (:sgecon_,:Float32)) @eval begin function gecon!(normtype::BlasChar, A::StridedMatrix{$elty}, anorm::$elty) # SUBROUTINE DGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK, @@ -3233,7 +3233,7 @@ for (gecon, elty) in work = Array($elty, 4n) iwork = Array(BlasInt, n) info = Array(BlasInt, 1) - ccall(($(string(gecon)),liblapack), Void, + ccall(($(blas_suffix(gecon)), liblapack), Void, (Ptr{Uint8}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3245,8 +3245,8 @@ for (gecon, elty) in end end for (gecon, elty, relty) in - ((@blas_suffix(:zgecon_),:Complex128,:Float64), - (@blas_suffix(:cgecon_),:Complex64, :Float32)) + ((:zgecon_,:Complex128,:Float64), + (:cgecon_,:Complex64, :Float32)) @eval begin function gecon!(normtype::BlasChar, A::StridedMatrix{$elty}, anorm::$relty) chkstride1(A) @@ -3267,7 +3267,7 @@ for (gecon, elty, relty) in work = Array($elty, 2n) rwork = Array($relty, 2n) info = Array(BlasInt, 1) - ccall(($(string(gecon)),liblapack), Void, + ccall(($(blas_suffix(gecon)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$relty}, Ptr{$elty}, Ptr{$relty}, Ptr{BlasInt}), @@ -3281,10 +3281,10 @@ end # Hessenberg form for (gehrd, elty) in - ((@blas_suffix(:dgehrd_),:Float64), - (@blas_suffix(:sgehrd_),:Float32), - (@blas_suffix(:zgehrd_),:Complex128), - (@blas_suffix(:cgehrd_),:Complex64)) + ((:dgehrd_,:Float64), + (:sgehrd_,:Float32), + (:zgehrd_,:Complex128), + (:cgehrd_,:Complex64)) @eval begin function gehrd!(ilo::Integer, ihi::Integer, A::StridedMatrix{$elty}) # .. Scalar Arguments .. @@ -3299,7 +3299,7 @@ for (gehrd, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gehrd)),liblapack), Void, + ccall(($(blas_suffix(gehrd)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3320,10 +3320,10 @@ gehrd!(A::StridedMatrix) = gehrd!(1, size(A, 1), A) # construct Q from Hessenberg for (orghr, elty) in - ((@blas_suffix(:dorghr_),:Float64), - (@blas_suffix(:sorghr_),:Float32), - (@blas_suffix(:zunghr_),:Complex128), - (@blas_suffix(:cunghr_),:Complex64)) + ((:dorghr_,:Float64), + (:sorghr_,:Float32), + (:zunghr_,:Complex128), + (:cunghr_,:Complex64)) @eval begin function orghr!(ilo::Integer, ihi::Integer, A::StridedMatrix{$elty}, tau::StridedVector{$elty}) # * .. Scalar Arguments .. @@ -3338,7 +3338,7 @@ for (orghr, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(orghr)),liblapack), Void, + ccall(($(blas_suffix(orghr)), liblapack), Void, (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), @@ -3357,8 +3357,8 @@ for (orghr, elty) in end # Schur forms for (gees, gges, elty) in - ((@blas_suffix(:dgees_),@blas_suffix(:dgges_),:Float64), - (@blas_suffix(:sgees_),@blas_suffix(:sgges_),:Float32)) + ((:dgees_,:dgges_,:Float64), + (:sgees_,:sgges_,:Float32)) @eval begin function gees!(jobvs::BlasChar, A::StridedMatrix{$elty}) # .. Scalar Arguments .. @@ -3380,7 +3380,7 @@ for (gees, gges, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gees)),liblapack), Void, + ccall(($(blas_suffix(gees)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, @@ -3422,7 +3422,7 @@ for (gees, gges, elty) in lwork = blas_int(-1) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gges)), liblapack), Void, + ccall(($(blas_suffix(gges)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -3446,8 +3446,8 @@ for (gees, gges, elty) in end end for (gees, gges, elty, relty) in - ((@blas_suffix(:zgees_),@blas_suffix(:zgges_),:Complex128,:Float64), - (@blas_suffix(:cgees_),@blas_suffix(:cgges_),:Complex64,:Float32)) + ((:zgees_,:zgges_,:Complex128,:Float64), + (:cgees_,:cgges_,:Complex64,:Float32)) @eval begin function gees!(jobvs::BlasChar, A::StridedMatrix{$elty}) # * .. Scalar Arguments .. @@ -3470,7 +3470,7 @@ for (gees, gges, elty, relty) in rwork = Array($relty, n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gees)),liblapack), Void, + ccall(($(blas_suffix(gees)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, @@ -3513,7 +3513,7 @@ for (gees, gges, elty, relty) in rwork = Array($relty, 8n) info = Array(BlasInt, 1) for i = 1:2 - ccall(($(string(gges)), liblapack), Void, + ccall(($(blas_suffix(gges)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{Void}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, @@ -3538,8 +3538,8 @@ for (gees, gges, elty, relty) in end # Reorder Schur forms for (trsen, elty) in - ((@blas_suffix(:dtrsen_),:Float64), - (@blas_suffix(:strsen_),:Float32)) + ((:dtrsen_,:Float64), + (:strsen_,:Float32)) @eval begin function trsen!(select::Array{Int}, T::StridedMatrix{$elty}, Q::StridedMatrix{$elty}) # * .. Scalar Arguments .. @@ -3565,7 +3565,7 @@ for (trsen, elty) in select = convert(Array{BlasInt}, select) for i = 1:2 - ccall(($(string(trsen)), liblapack), Void, + ccall(($(blas_suffix(trsen)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{Void}, Ptr{Void}, @@ -3590,8 +3590,8 @@ for (trsen, elty) in end for (trsen, elty) in - ((@blas_suffix(:ztrsen_),:Complex128), - (@blas_suffix(:ctrsen_),:Complex64)) + ((:ztrsen_,:Complex128), + (:ctrsen_,:Complex64)) @eval begin function trsen!(select::Array{Int}, T::StridedMatrix{$elty}, Q::StridedMatrix{$elty}) # * .. Scalar Arguments .. @@ -3613,7 +3613,7 @@ for (trsen, elty) in select = convert(Array{BlasInt}, select) for i = 1:2 - ccall(($(string(trsen)), liblapack), Void, + ccall(($(blas_suffix(trsen)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{Void}, Ptr{Void}, @@ -3638,10 +3638,10 @@ end ### Rectangular full packed format # Symmetric rank-k operation for matrix in RFP format. -for (fn, elty, relty) in ((@blas_suffix(:dsfrk_), :Float64, :Float64), - (@blas_suffix(:ssfrk_), :Float32, :Float32), - (@blas_suffix(:zhfrk_), :Complex128, :Float64), - (@blas_suffix(:chfrk_), :Complex64, :Float32)) +for (fn, elty, relty) in ((:dsfrk_, :Float64, :Float64), + (:ssfrk_, :Float32, :Float32), + (:zhfrk_, :Complex128, :Float64), + (:chfrk_, :Complex64, :Float32)) @eval begin function sfrk!(transr::Char, uplo::Char, trans::Char, alpha::Real, A::StridedMatrix{$elty}, beta::Real, C::StridedVector{$elty}) chkstride1(A) @@ -3651,7 +3651,7 @@ for (fn, elty, relty) in ((@blas_suffix(:dsfrk_), :Float64, :Float64), k, n = size(A) end lda = max(1, stride(A, 2)) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{$elty}), @@ -3664,15 +3664,15 @@ for (fn, elty, relty) in ((@blas_suffix(:dsfrk_), :Float64, :Float64), end # Cholesky factorization of a real symmetric positive definite matrix A -for (fn, elty) in ((@blas_suffix(:dpftrf_), :Float64), - (@blas_suffix(:spftrf_), :Float32), - (@blas_suffix(:zpftrf_), :Complex128), - (@blas_suffix(:cpftrf_), :Complex64)) +for (fn, elty) in ((:dpftrf_, :Float64), + (:spftrf_, :Float32), + (:zpftrf_, :Complex128), + (:cpftrf_, :Complex64)) @eval begin function pftrf!(transr::Char, uplo::Char, A::StridedVector{$elty}) n = int(div(sqrt(8length(A)), 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &n, A, @@ -3685,15 +3685,15 @@ for (fn, elty) in ((@blas_suffix(:dpftrf_), :Float64), end # Computes the inverse of a (real) symmetric positive definite matrix A using the Cholesky factorization -for (fn, elty) in ((@blas_suffix(:dpftri_), :Float64), - (@blas_suffix(:spftri_), :Float32), - (@blas_suffix(:zpftri_), :Complex128), - (@blas_suffix(:cpftri_), :Complex64)) +for (fn, elty) in ((:dpftri_, :Float64), + (:spftri_, :Float32), + (:zpftri_, :Complex128), + (:cpftri_, :Complex64)) @eval begin function pftri!(transr::Char, uplo::Char, A::StridedVector{$elty}) n = int(div(sqrt(8length(A)), 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &n, A, @@ -3706,10 +3706,10 @@ for (fn, elty) in ((@blas_suffix(:dpftri_), :Float64), end # DPFTRS solves a system of linear equations A*X = B with a symmetric positive definite matrix A using the Cholesky factorization -for (fn, elty) in ((@blas_suffix(:dpftrs_), :Float64), - (@blas_suffix(:spftrs_), :Float32), - (@blas_suffix(:zpftrs_), :Complex128), - (@blas_suffix(:cpftrs_), :Complex64)) +for (fn, elty) in ((:dpftrs_, :Float64), + (:spftrs_, :Float32), + (:zpftrs_, :Complex128), + (:cpftrs_, :Complex64)) @eval begin function pftrs!(transr::Char, uplo::Char, A::StridedVector{$elty}, B::StridedVecOrMat{$elty}) chkstride1(B) @@ -3718,7 +3718,7 @@ for (fn, elty) in ((@blas_suffix(:dpftrs_), :Float64), nhrs = size(B, 2) ldb = max(1, stride(B, 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &transr, &uplo, &n, &nhrs, @@ -3731,17 +3731,17 @@ for (fn, elty) in ((@blas_suffix(:dpftrs_), :Float64), end # Solves a matrix equation (one operand is a triangular matrix in RFP format) -for (fn, elty) in ((@blas_suffix(:dtfsm_), :Float64), - (@blas_suffix(:stfsm_), :Float32), - (@blas_suffix(:ztfsm_), :Complex128), - (@blas_suffix(:ctfsm_), :Complex64)) +for (fn, elty) in ((:dtfsm_, :Float64), + (:stfsm_, :Float32), + (:ztfsm_, :Complex128), + (:ctfsm_, :Complex64)) @eval begin function pftrs!(transr::Char, side::Char, uplo::Char, trans::Char, diag::Char, alpha::Real, A::StridedVector{$elty}, B::StridedMatrix{$elty}) chkstride1(B) m, n = size(B) if int(div(sqrt(8length(A)), 2)) != m throw(DimensionMismatch("")) end ldb = max(1, stride(B, 2)) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}), @@ -3754,15 +3754,15 @@ for (fn, elty) in ((@blas_suffix(:dtfsm_), :Float64), end # Computes the inverse of a triangular matrix A stored in RFP format. -for (fn, elty) in ((@blas_suffix(:dtftri_), :Float64), - (@blas_suffix(:stftri_), :Float32), - (@blas_suffix(:ztftri_), :Complex128), - (@blas_suffix(:ctftri_), :Complex64)) +for (fn, elty) in ((:dtftri_, :Float64), + (:stftri_, :Float32), + (:ztftri_, :Complex128), + (:ctftri_, :Complex64)) @eval begin function tftri!(transr::Char, uplo::Char, diag::Char, A::StridedVector{$elty}) n = int(div(sqrt(8length(A)), 2)) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &diag, &n, @@ -3775,16 +3775,16 @@ for (fn, elty) in ((@blas_suffix(:dtftri_), :Float64), end # Copies a triangular matrix from the rectangular full packed format (TF) to the standard full format (TR) -for (fn, elty) in ((@blas_suffix(:dtfttr_), :Float64), - (@blas_suffix(:stfttr_), :Float32), - (@blas_suffix(:ztfttr_), :Complex128), - (@blas_suffix(:ctfttr_), :Complex64)) +for (fn, elty) in ((:dtfttr_, :Float64), + (:stfttr_, :Float32), + (:ztfttr_, :Complex128), + (:ctfttr_, :Complex64)) @eval begin function tfttr!(transr::Char, uplo::Char, Arf::StridedVector{$elty}) n = int(div(sqrt(8length(Arf)), 2)) info = Array(BlasInt, 1) A = similar(Arf, $elty, n, n) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{$elty}, Ptr{BlasInt}, Ptr{BlasInt}), &transr, &uplo, &n, Arf, @@ -3796,10 +3796,10 @@ for (fn, elty) in ((@blas_suffix(:dtfttr_), :Float64), end # Copies a triangular matrix from the standard full format (TR) to the rectangular full packed format (TF). -for (fn, elty) in ((@blas_suffix(:dtrttf_), :Float64), - (@blas_suffix(:strttf_), :Float32), - (@blas_suffix(:ztrttf_), :Complex128), - (@blas_suffix(:ctrttf_), :Complex64)) +for (fn, elty) in ((:dtrttf_, :Float64), + (:strttf_, :Float32), + (:ztrttf_, :Complex128), + (:ctrttf_, :Complex64)) @eval begin function trttf!(transr::Char, uplo::Char, A::StridedMatrix{$elty}) chkstride1(A) @@ -3807,7 +3807,7 @@ for (fn, elty) in ((@blas_suffix(:dtrttf_), :Float64), lda = max(1, stride(A, 2)) info = Array(BlasInt, 1) Arf = similar(A, $elty, div(n*(n+1), 2)) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}), &transr, &uplo, &n, A, @@ -3819,10 +3819,10 @@ for (fn, elty) in ((@blas_suffix(:dtrttf_), :Float64), end # Solves the real Sylvester matrix equation: op(A)*X +- X*op(B) = scale*C and A and B are both upper quasi triangular. -for (fn, elty, relty) in ((@blas_suffix(:dtrsyl_), :Float64, :Float64), - (@blas_suffix(:strsyl_), :Float32, :Float32), - (@blas_suffix(:ztrsyl_), :Complex128, :Float64), - (@blas_suffix(:ctrsyl_), :Complex64, :Float32)) +for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), + (:strsyl_, :Float32, :Float32), + (:ztrsyl_, :Complex128, :Float64), + (:ctrsyl_, :Complex64, :Float32)) @eval begin function trsyl!(transa::BlasChar, transb::BlasChar, A::StridedMatrix{$elty}, B::StridedMatrix{$elty}, C::StridedMatrix{$elty}, isgn::Int=1) chkstride1(A, B, C) @@ -3836,7 +3836,7 @@ for (fn, elty, relty) in ((@blas_suffix(:dtrsyl_), :Float64, :Float64), scale = Array($relty, 1) info = Array(BlasInt, 1) - ccall(($(string(fn)), liblapack), Void, + ccall(($(blas_suffix(fn)), liblapack), Void, (Ptr{BlasChar}, Ptr{BlasChar}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$elty}, Ptr{BlasInt}, Ptr{$relty}, Ptr{BlasInt}), diff --git a/base/util.jl b/base/util.jl index 906501b38703e..c75cecf9613e5 100644 --- a/base/util.jl +++ b/base/util.jl @@ -119,14 +119,10 @@ function blas_vendor() end if blas_vendor() == :openblas64 - macro blas_suffix(x) - return :(symbol(string($x)*"64_")) - end + blas_suffix(x) = string(x)*"64_" openblas_get_config() = strip(bytestring( ccall((:openblas_get_config64_, Base.libblas_name), Ptr{Uint8}, () ))) else - macro blas_suffix(x) - return x - end + blas_suffix(x) = string(x) openblas_get_config() = strip(bytestring( ccall((:openblas_get_config, Base.libblas_name), Ptr{Uint8}, () ))) end