@@ -2,15 +2,20 @@ module LinearSolveBLISExt
2
2
3
3
using Libdl
4
4
using blis_jll
5
+ using LAPACK_jll
5
6
using LinearAlgebra
6
7
using LinearSolve
7
8
8
- using LinearAlgebra: BlasInt, LU
9
+ using LinearAlgebra: libblastrampoline, BlasInt, LU
9
10
using LinearAlgebra. LAPACK: require_one_based_indexing, chkfinite, chkstride1,
10
11
@blasfunc , chkargsok
11
12
using LinearSolve: ArrayInterface, BLISLUFactorization, @get_cacheval , LinearCache, SciMLBase
12
13
13
14
const global libblis = blis_jll. blis
15
+ const global liblapack = libblastrampoline
16
+
17
+ BLAS. lbt_forward (libblis; clear= true , verbose= true , suffix_hint= " 64_" )
18
+ BLAS. lbt_forward (LAPACK_jll. liblapack_path; suffix_hint= " 64_" , verbose= true )
14
19
15
20
function getrf! (A:: AbstractMatrix{<:ComplexF64} ;
16
21
ipiv = similar (A, BlasInt, min (size (A, 1 ), size (A, 2 ))),
@@ -24,7 +29,7 @@ function getrf!(A::AbstractMatrix{<:ComplexF64};
24
29
if isempty (ipiv)
25
30
ipiv = similar (A, BlasInt, min (size (A, 1 ), size (A, 2 )))
26
31
end
27
- ccall ((@blasfunc (zgetrf_), libblis ), Cvoid,
32
+ ccall ((@blasfunc (zgetrf_), liblapack ), Cvoid,
28
33
(Ref{BlasInt}, Ref{BlasInt}, Ptr{ComplexF64},
29
34
Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}),
30
35
m, n, A, lda, ipiv, info)
@@ -44,7 +49,7 @@ function getrf!(A::AbstractMatrix{<:ComplexF32};
44
49
if isempty (ipiv)
45
50
ipiv = similar (A, BlasInt, min (size (A, 1 ), size (A, 2 )))
46
51
end
47
- ccall ((@blasfunc (cgetrf_), libblis ), Cvoid,
52
+ ccall ((@blasfunc (cgetrf_), liblapack ), Cvoid,
48
53
(Ref{BlasInt}, Ref{BlasInt}, Ptr{ComplexF32},
49
54
Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}),
50
55
m, n, A, lda, ipiv, info)
@@ -64,7 +69,7 @@ function getrf!(A::AbstractMatrix{<:Float64};
64
69
if isempty (ipiv)
65
70
ipiv = similar (A, BlasInt, min (size (A, 1 ), size (A, 2 )))
66
71
end
67
- ccall ((@blasfunc (dgetrf_), libblis ), Cvoid,
72
+ ccall ((@blasfunc (dgetrf_), liblapack ), Cvoid,
68
73
(Ref{BlasInt}, Ref{BlasInt}, Ptr{Float64},
69
74
Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}),
70
75
m, n, A, lda, ipiv, info)
@@ -84,7 +89,7 @@ function getrf!(A::AbstractMatrix{<:Float32};
84
89
if isempty (ipiv)
85
90
ipiv = similar (A, BlasInt, min (size (A, 1 ), size (A, 2 )))
86
91
end
87
- ccall ((@blasfunc (sgetrf_), libblis ), Cvoid,
92
+ ccall ((@blasfunc (sgetrf_), liblapack ), Cvoid,
88
93
(Ref{BlasInt}, Ref{BlasInt}, Ptr{Float32},
89
94
Ref{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}),
90
95
m, n, A, lda, ipiv, info)
@@ -108,7 +113,7 @@ function getrs!(trans::AbstractChar,
108
113
throw (DimensionMismatch (" ipiv has length $(length (ipiv)) , but needs to be $n " ))
109
114
end
110
115
nrhs = size (B, 2 )
111
- ccall ((" zgetrs_" , libblis ), Cvoid,
116
+ ccall ((" zgetrs_" , liblapack ), Cvoid,
112
117
(Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{ComplexF64}, Ref{BlasInt},
113
118
Ptr{BlasInt}, Ptr{ComplexF64}, Ref{BlasInt}, Ptr{BlasInt}, Clong),
114
119
trans, n, size (B, 2 ), A, max (1 , stride (A, 2 )), ipiv, B, max (1 , stride (B, 2 )), info,
@@ -133,7 +138,7 @@ function getrs!(trans::AbstractChar,
133
138
throw (DimensionMismatch (" ipiv has length $(length (ipiv)) , but needs to be $n " ))
134
139
end
135
140
nrhs = size (B, 2 )
136
- ccall ((" cgetrs_" , libblis ), Cvoid,
141
+ ccall ((" cgetrs_" , liblapack ), Cvoid,
137
142
(Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{ComplexF32}, Ref{BlasInt},
138
143
Ptr{BlasInt}, Ptr{ComplexF32}, Ref{BlasInt}, Ptr{BlasInt}, Clong),
139
144
trans, n, size (B, 2 ), A, max (1 , stride (A, 2 )), ipiv, B, max (1 , stride (B, 2 )), info,
@@ -158,7 +163,7 @@ function getrs!(trans::AbstractChar,
158
163
throw (DimensionMismatch (" ipiv has length $(length (ipiv)) , but needs to be $n " ))
159
164
end
160
165
nrhs = size (B, 2 )
161
- ccall ((" dgetrs_" , libblis ), Cvoid,
166
+ ccall ((" dgetrs_" , liblapack ), Cvoid,
162
167
(Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{Float64}, Ref{BlasInt},
163
168
Ptr{BlasInt}, Ptr{Float64}, Ref{BlasInt}, Ptr{BlasInt}, Clong),
164
169
trans, n, size (B, 2 ), A, max (1 , stride (A, 2 )), ipiv, B, max (1 , stride (B, 2 )), info,
@@ -183,7 +188,7 @@ function getrs!(trans::AbstractChar,
183
188
throw (DimensionMismatch (" ipiv has length $(length (ipiv)) , but needs to be $n " ))
184
189
end
185
190
nrhs = size (B, 2 )
186
- ccall ((" sgetrs_" , libblis ), Cvoid,
191
+ ccall ((" sgetrs_" , liblapack ), Cvoid,
187
192
(Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ptr{Float32}, Ref{BlasInt},
188
193
Ptr{BlasInt}, Ptr{Float32}, Ref{BlasInt}, Ptr{BlasInt}, Clong),
189
194
trans, n, size (B, 2 ), A, max (1 , stride (A, 2 )), ipiv, B, max (1 , stride (B, 2 )), info,
0 commit comments