Skip to content

Commit 78158af

Browse files
use BlasInt everywhere with MKL
1 parent 342307e commit 78158af

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/LinearSolveMKLExt.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getrf!(A::AbstractMatrix{<:Float32}; ipiv = similar(A, BlasInt, min(siz
4444
A, ipiv, info[], info #Error code is stored in LU factorization type
4545
end
4646

47-
function getrs!(trans::AbstractChar, A::AbstractMatrix{<:Float64}, ipiv::AbstractVector{Cint}, B::AbstractVecOrMat{<:Float64}; info = Ref{Cint}())
47+
function getrs!(trans::AbstractChar, A::AbstractMatrix{<:Float64}, ipiv::AbstractVector{BlasInt}, B::AbstractVecOrMat{<:Float64}; info = Ref{BlasInt}())
4848
require_one_based_indexing(A, ipiv, B)
4949
LinearAlgebra.LAPACK.chktrans(trans)
5050
chkstride1(A, B, ipiv)
@@ -57,14 +57,14 @@ function getrs!(trans::AbstractChar, A::AbstractMatrix{<:Float64}, ipiv::Abstrac
5757
end
5858
nrhs = size(B, 2)
5959
ccall(("dgetrs_", MKL_jll.libmkl_rt), Cvoid,
60-
(Ref{UInt8}, Ref{Cint}, Ref{Cint}, Ptr{Float64}, Ref{Cint},
61-
Ptr{Cint}, Ptr{Float64}, Ref{Cint}, Ptr{Cint}, Clong),
60+
(Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{Float64}, Ref{BlasInt},
61+
Ptr{BlasInt}, Ptr{Float64}, Ref{BlasInt}, Ptr{BlasInt}, Clong),
6262
trans, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1)
6363
LinearAlgebra.LAPACK.chklapackerror(BlasInt(info[]))
6464
B
6565
end
6666

67-
function getrs!(trans::AbstractChar, A::AbstractMatrix{<:Float32}, ipiv::AbstractVector{Cint}, B::AbstractVecOrMat{<:Float32}; info = Ref{Cint}())
67+
function getrs!(trans::AbstractChar, A::AbstractMatrix{<:Float32}, ipiv::AbstractVector{BlasInt}, B::AbstractVecOrMat{<:Float32}; info = Ref{BlasInt}())
6868
require_one_based_indexing(A, ipiv, B)
6969
LinearAlgebra.LAPACK.chktrans(trans)
7070
chkstride1(A, B, ipiv)
@@ -77,8 +77,8 @@ function getrs!(trans::AbstractChar, A::AbstractMatrix{<:Float32}, ipiv::Abstrac
7777
end
7878
nrhs = size(B, 2)
7979
ccall(("sgetrs_", MKL_jll.libmkl_rt), Cvoid,
80-
(Ref{UInt8}, Ref{Cint}, Ref{Cint}, Ptr{Float32}, Ref{Cint},
81-
Ptr{Cint}, Ptr{Float32}, Ref{Cint}, Ptr{Cint}, Clong),
80+
(Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{Float32}, Ref{BlasInt},
81+
Ptr{BlasInt}, Ptr{Float32}, Ref{BlasInt}, Ptr{BlasInt}, Clong),
8282
trans, n, size(B,2), A, max(1,stride(A,2)), ipiv, B, max(1,stride(B,2)), info, 1)
8383
LinearAlgebra.LAPACK.chklapackerror(BlasInt(info[]))
8484
B

0 commit comments

Comments
 (0)