From 74f11ea9d8a4978fbbaa9a5e61a6d71bd2f0a448 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 28 Jul 2024 09:50:01 -0400 Subject: [PATCH] Default preference for MKL checks if Ryzen --- src/LinearSolve.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 894c6e0d..d195a69d 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -44,7 +44,16 @@ import PrecompileTools const CRC = ChainRulesCore -if Preferences.@load_preference("LoadMKL_JLL", true) +# Check if Ryzen, since that's where MKL is slow +function is_zen() + # znverX + n = Sys.CPU_NAME + length(n) == 6 || return false + return n[1] == 'z' && n[2] == 'n' && n[3] == 'v' && + n[4] == 'e' && n[5] == 'r' +end + +@static if Preferences.@load_preference("LoadMKL_JLL", is_zen()) using MKL_jll const usemkl = MKL_jll.is_available() else