Skip to content

Commit c0cc82b

Browse files
committed
restructuring/formatting
1 parent 8b988a1 commit c0cc82b

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

src/MKL.jl

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ else
3131
mkl_found || @warn("Couldn't find MKL library at $libmkl_rt.")
3232
end
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-
4534
if Base.USE_BLAS64
4635
const MKLBlasInt = Int64
4736
else
@@ -62,6 +51,14 @@ end
6251
INTERFACE_GNU
6352
end
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+
6562
function 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
7572
end
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+
7779
function lbt_mkl_forwarding()
7880
if Sys.isapple()
7981
set_threading_layer(THREADING_SEQUENTIAL)
@@ -101,9 +103,4 @@ function __init__()
101103
end
102104
end
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-
109106
end # module

0 commit comments

Comments
 (0)