31
31
mkl_found || @warn (" Couldn't find MKL library at $libmkl_rt ." )
32
32
end
33
33
34
- # Changing the MKL provider/path preference
35
- function set_mkl_path (path)
36
- if lowercase (path) ∉ (" mkl_jll" , " system" ) && ! isfile (path)
37
- error (" The provided argument $path neither seems to be a valid path to libmkl_rt nor \" mkl_jll\" or \" system\" ." )
38
- end
39
- @set_preferences! (" mkl_path" => path)
40
- @info (" New MKL preference set; please restart Julia to see this take effect" , path)
41
- end
42
-
43
- using LinearAlgebra
44
-
45
34
if Base. USE_BLAS64
46
35
const MKLBlasInt = Int64
47
36
else
62
51
INTERFACE_GNU
63
52
end
64
53
54
+ function set_mkl_path (path)
55
+ if lowercase (path) ∉ (" mkl_jll" , " system" ) && ! isfile (path)
56
+ error (" The provided argument $path neither seems to be a valid path to libmkl_rt nor \" mkl_jll\" or \" system\" ." )
57
+ end
58
+ @set_preferences! (" mkl_path" => path)
59
+ @info (" New MKL preference set; please restart Julia to see this take effect" , path)
60
+ end
61
+
65
62
function set_threading_layer (layer:: Threading = THREADING_SEQUENTIAL)
66
63
err = ccall ((:MKL_Set_Threading_Layer , libmkl_rt), Cint, (Cint,), layer)
67
64
err == - 1 && throw (ErrorException (" MKL_Set_Threading_Layer() returned -1" ))
@@ -74,6 +71,11 @@ function set_interface_layer(interface::Interface = INTERFACE_LP64)
74
71
return nothing
75
72
end
76
73
74
+ function mklnorm (x:: Vector{Float64} )
75
+ ccall ((:dnrm2_ , libmkl_rt), Float64,
76
+ (Ref{MKLBlasInt}, Ptr{Float64}, Ref{MKLBlasInt}), length (x), x, 1 )
77
+ end
78
+
77
79
function lbt_mkl_forwarding ()
78
80
if Sys. isapple ()
79
81
set_threading_layer (THREADING_SEQUENTIAL)
@@ -101,9 +103,4 @@ function __init__()
101
103
end
102
104
end
103
105
104
- function mklnorm (x:: Vector{Float64} )
105
- ccall ((:dnrm2_ , libmkl_rt), Float64,
106
- (Ref{MKLBlasInt}, Ptr{Float64}, Ref{MKLBlasInt}), length (x), x, 1 )
107
- end
108
-
109
106
end # module
0 commit comments