3131 mkl_found || @warn (" Couldn't find MKL library at $libmkl_rt ." )
3232end
3333
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-
4534if Base. USE_BLAS64
4635 const MKLBlasInt = Int64
4736else
6251 INTERFACE_GNU
6352end
6453
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+
6562function set_threading_layer (layer:: Threading = THREADING_SEQUENTIAL)
6663 err = ccall ((:MKL_Set_Threading_Layer , libmkl_rt), Cint, (Cint,), layer)
6764 err == - 1 && throw (ErrorException (" MKL_Set_Threading_Layer() returned -1" ))
@@ -74,6 +71,11 @@ function set_interface_layer(interface::Interface = INTERFACE_LP64)
7471 return nothing
7572end
7673
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+
7779function lbt_mkl_forwarding ()
7880 if Sys. isapple ()
7981 set_threading_layer (THREADING_SEQUENTIAL)
@@ -101,9 +103,4 @@ function __init__()
101103 end
102104end
103105
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-
109106end # module
0 commit comments