Skip to content

Conversation

ChrisRackauckas
Copy link
Member

No description provided.

Copy link
Contributor

@chriselrod chriselrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; 0 runtime cost.

@chriselrod
Copy link
Contributor

Actually, hold on, let me see if I can find a good way to query vendor.

@chriselrod
Copy link
Contributor

I couldn't find anything in Base.
If you're willing to add a dependency on CpuId.jl, you could do something like

@static if Sys.ARCH === :x86_64
    using CpuId
    if CpuId.cpuvendor() === :Intel
        # using MKL
    else
        # don't
    end
else
    # don't
end

@ChrisRackauckas
Copy link
Member Author

This is good enough. Besides, it's not vendor anyways, AMD is fine with MKL from my tests, it's just the server chips.

But wait, that wouldn't be Ryzen that would be EPYC, so this may need to change.

@chriselrod
Copy link
Contributor

Note that this is actually znver4, not znver3, but the detection is outdated:

julia> Sys.CPU_NAME
"znver3"

julia> first(Sys.cpu_info()).model
"AMD EPYC 9354 32-Core Processor"

julia> occursin("EPYC", first(Sys.cpu_info()).model)
true

julia> using CpuId

julia> cpubrand()
"AMD EPYC 9354 32-Core Processor                "

julia> occursin("EPYC", cpubrand())
true

znver* will detect Ryzen, whether laptop, desktop, or EPYC.
If you want to detect EPYC-only, hopefully the model name will work?
You could use CpuId.cpubrand(), or get it from Sys.cpu_info() to avoid the dependency.

@ChrisRackauckas ChrisRackauckas deleted the ChrisRackauckas-patch-1 branch May 19, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants