2
2
# # Borrowed from Knet.jl, adapted for compile-time constants
3
3
4
4
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
6
13
7
14
using Compat: get_num_threads, set_num_threads # needs Compat 3.13, for any Julia < 1.6
8
15
@@ -48,7 +55,7 @@ for (gemm, elt) in gemm_datatype_mappings
48
55
ldb = N
49
56
end
50
57
ldc = M
51
- ccall ((@blasfunc ($ (gemm)), libblastrampoline ), Nothing,
58
+ ccall ((@blasfunc ($ (gemm)), libblas ), Nothing,
52
59
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
53
60
Ref{BlasInt}, Ref{$ elt}, Ptr{$ elt}, Ref{BlasInt},
54
61
Ptr{$ elt}, Ref{BlasInt}, Ref{$ elt}, Ptr{$ elt},
@@ -106,7 +113,7 @@ for (gemm, elt) in gemm_datatype_mappings
106
113
ptrBk = ptrB + (k- 1 ) * strB * sizeof ($ elt)
107
114
ptrCk = ptrC + (k- 1 ) * strC * sizeof ($ elt)
108
115
109
- ccall ((@blasfunc ($ (gemm)), libblastrampoline ), Nothing,
116
+ ccall ((@blasfunc ($ (gemm)), libblas ), Nothing,
110
117
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
111
118
Ref{BlasInt}, Ref{$ elt}, Ptr{$ elt}, Ref{BlasInt},
112
119
Ptr{$ elt}, Ref{BlasInt}, Ref{$ elt}, Ptr{$ elt},
@@ -128,7 +135,7 @@ for (gemm, elt) in gemm_datatype_mappings
128
135
ptrBk = ptrB + (k- 1 ) * strB * sizeof ($ elt)
129
136
ptrCk = ptrC + (k- 1 ) * strC * sizeof ($ elt)
130
137
131
- ccall ((@blasfunc ($ (gemm)), libblastrampoline ), Nothing,
138
+ ccall ((@blasfunc ($ (gemm)), libblas ), Nothing,
132
139
(Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt},
133
140
Ref{BlasInt}, Ref{$ elt}, Ptr{$ elt}, Ref{BlasInt},
134
141
Ptr{$ elt}, Ref{BlasInt}, Ref{$ elt}, Ptr{$ elt},
0 commit comments