Skip to content

Commit f3bc6bf

Browse files
chriselrodKristofferC
authored andcommitted
Use max(1, Sys.CPU_THREADS) BLAS threads for apple aarch64. (#46085)
(cherry picked from commit 97df6db)
1 parent 1549064 commit f3bc6bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stdlib/LinearAlgebra/src/LinearAlgebra.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,11 @@ function __init__()
583583
Base.at_disable_library_threading(() -> BLAS.set_num_threads(1))
584584

585585
if !haskey(ENV, "OPENBLAS_NUM_THREADS")
586-
BLAS.set_num_threads(max(1, Sys.CPU_THREADS ÷ 2))
586+
@static if Sys.isapple() && Base.BinaryPlatforms.arch(Base.BinaryPlatforms.HostPlatform()) == "aarch64"
587+
BLAS.set_num_threads(max(1, Sys.CPU_THREADS))
588+
else
589+
BLAS.set_num_threads(max(1, Sys.CPU_THREADS ÷ 2))
590+
end
587591
end
588592
end
589593

0 commit comments

Comments
 (0)