Skip to content

Commit 74f11ea

Browse files
Default preference for MKL checks if Ryzen
1 parent 844253c commit 74f11ea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/LinearSolve.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ import PrecompileTools
4444

4545
const CRC = ChainRulesCore
4646

47-
if Preferences.@load_preference("LoadMKL_JLL", true)
47+
# Check if Ryzen, since that's where MKL is slow
48+
function is_zen()
49+
# znverX
50+
n = Sys.CPU_NAME
51+
length(n) == 6 || return false
52+
return n[1] == 'z' && n[2] == 'n' && n[3] == 'v' &&
53+
n[4] == 'e' && n[5] == 'r'
54+
end
55+
56+
@static if Preferences.@load_preference("LoadMKL_JLL", is_zen())
4857
using MKL_jll
4958
const usemkl = MKL_jll.is_available()
5059
else

0 commit comments

Comments
 (0)