Skip to content

Commit 773d8ee

Browse files
committed
Fix for Julia v1.6
1 parent 3ea27db commit 773d8ee

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/gemm.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
## Borrowed from Knet.jl, adapted for compile-time constants
33

44
using LinearAlgebra
5-
using LinearAlgebra.BLAS: libblastrampoline, BlasInt, @blasfunc
5+
using LinearAlgebra.BLAS: BlasInt, @blasfunc
6+
7+
if VERSION >= v"1.7-"
8+
using LinearAlgebra.BLAS: libblastrampoline
9+
libblas = libblastrampoline
10+
else
11+
using LinearAlgebra.BLAS: libblas
12+
end
613

714
using Compat: get_num_threads, set_num_threads # needs Compat 3.13, for any Julia < 1.6
815

@@ -48,7 +55,7 @@ for (gemm, elt) in gemm_datatype_mappings
4855
ldb = N
4956
end
5057
ldc = M
51-
ccall((@blasfunc($(gemm)), libblastrampoline), Nothing,
58+
ccall((@blasfunc($(gemm)), libblas), Nothing,
5259
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
5360
Ref{BlasInt}, Ref{$elt}, Ptr{$elt}, Ref{BlasInt},
5461
Ptr{$elt}, Ref{BlasInt}, Ref{$elt}, Ptr{$elt},
@@ -106,7 +113,7 @@ for (gemm, elt) in gemm_datatype_mappings
106113
ptrBk = ptrB + (k-1) * strB * sizeof($elt)
107114
ptrCk = ptrC + (k-1) * strC * sizeof($elt)
108115

109-
ccall((@blasfunc($(gemm)), libblastrampoline), Nothing,
116+
ccall((@blasfunc($(gemm)), libblas), Nothing,
110117
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
111118
Ref{BlasInt}, Ref{$elt}, Ptr{$elt}, Ref{BlasInt},
112119
Ptr{$elt}, Ref{BlasInt}, Ref{$elt}, Ptr{$elt},
@@ -128,7 +135,7 @@ for (gemm, elt) in gemm_datatype_mappings
128135
ptrBk = ptrB + (k-1) * strB * sizeof($elt)
129136
ptrCk = ptrC + (k-1) * strC * sizeof($elt)
130137

131-
ccall((@blasfunc($(gemm)), libblastrampoline), Nothing,
138+
ccall((@blasfunc($(gemm)), libblas), Nothing,
132139
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
133140
Ref{BlasInt}, Ref{$elt}, Ptr{$elt}, Ref{BlasInt},
134141
Ptr{$elt}, Ref{BlasInt}, Ref{$elt}, Ptr{$elt},

0 commit comments

Comments
 (0)