Skip to content

Commit 57711af

Browse files
Fix CPUSummary integration - use correct function names
- Fixed CPUSummary.num_cores() instead of num_physical_cores() - Use Sys.CPU_THREADS for logical cores - Use Threads.nthreads() for Julia threads - Fixed BLAS thread count with LinearAlgebra.BLAS.get_num_threads() - Use standard Julia functions where CPUSummary doesn't provide equivalents
1 parent 4e58631 commit 57711af

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

lib/LinearSolveAutotune/src/LinearSolveAutotune.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ function Base.show(io::IO, results::AutotuneResults)
4747
println(io, "LinearSolve.jl Autotune Results")
4848
println(io, "="^60)
4949

50-
# System info summary using CPUSummary
50+
# System info summary
5151
println(io, "\n📊 System Information:")
5252
println(io, " • CPU: ", get(results.sysinfo, "cpu_name", "Unknown"))
53-
println(io, " • OS: ", CPUSummary.os_name(), " (", get(results.sysinfo, "os", "Unknown"), ")")
53+
println(io, " • OS: ", get(results.sysinfo, "os_name", "Unknown"), " (", get(results.sysinfo, "os", "Unknown"), ")")
5454
println(io, " • Julia: ", get(results.sysinfo, "julia_version", "Unknown"))
55-
println(io, " • Threads: ", CPUSummary.num_threads(), " (BLAS: ", CPUSummary.blas_num_threads(), ")")
55+
println(io, " • Threads: ", get(results.sysinfo, "num_threads", "Unknown"), " (BLAS: ", get(results.sysinfo, "blas_num_threads", "Unknown"), ")")
5656

5757
# Results summary
5858
successful_results = filter(row -> row.success, results.results_df)

lib/LinearSolveAutotune/src/gpu_detection.jl

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,28 @@ function get_system_info()
7878

7979
info["julia_version"] = string(VERSION)
8080
info["os"] = string(Sys.KERNEL)
81-
info["os_name"] = CPUSummary.os_name()
81+
info["os_name"] = Sys.iswindows() ? "Windows" : Sys.islinux() ? "Linux" : Sys.isapple() ? "macOS" : "Other"
8282
info["arch"] = string(Sys.ARCH)
83-
info["cpu_name"] = CPUSummary.cpu_name()
84-
info["num_cores"] = CPUSummary.num_physical_cores()
85-
info["num_logical_cores"] = CPUSummary.num_logical_cores()
86-
info["num_threads"] = CPUSummary.num_threads()
87-
info["blas_num_threads"] = CPUSummary.blas_num_threads()
83+
84+
# Use CPUSummary where available, fallback to Sys otherwise
85+
try
86+
info["cpu_name"] = string(Sys.CPU_NAME)
87+
catch
88+
info["cpu_name"] = "Unknown"
89+
end
90+
91+
# CPUSummary.num_cores() returns the physical cores
92+
info["num_cores"] = CPUSummary.num_cores()
93+
info["num_logical_cores"] = Sys.CPU_THREADS
94+
info["num_threads"] = Threads.nthreads()
95+
96+
# BLAS threads
97+
try
98+
info["blas_num_threads"] = LinearAlgebra.BLAS.get_num_threads()
99+
catch
100+
info["blas_num_threads"] = 1
101+
end
102+
88103
info["blas_vendor"] = string(LinearAlgebra.BLAS.vendor())
89104
info["has_cuda"] = is_cuda_available()
90105
info["has_metal"] = is_metal_available()
@@ -152,19 +167,19 @@ function get_detailed_system_info()
152167
end
153168

154169
try
155-
system_data["cpu_cores"] = CPUSummary.num_physical_cores()
170+
system_data["cpu_cores"] = CPUSummary.num_cores()
156171
catch
157172
system_data["cpu_cores"] = "unknown"
158173
end
159174

160175
try
161-
system_data["cpu_logical_cores"] = CPUSummary.num_logical_cores()
176+
system_data["cpu_logical_cores"] = Sys.CPU_THREADS
162177
catch
163178
system_data["cpu_logical_cores"] = "unknown"
164179
end
165180

166181
try
167-
system_data["julia_threads"] = CPUSummary.num_threads()
182+
system_data["julia_threads"] = Threads.nthreads()
168183
catch
169184
system_data["julia_threads"] = "unknown"
170185
end
@@ -181,16 +196,16 @@ function get_detailed_system_info()
181196
system_data["machine"] = "unknown"
182197
end
183198

184-
# CPU details using CPUSummary
199+
# CPU details
185200
try
186-
system_data["cpu_name"] = CPUSummary.cpu_name()
201+
system_data["cpu_name"] = string(Sys.CPU_NAME)
187202
catch
188203
system_data["cpu_name"] = "unknown"
189204
end
190205

191206
try
192-
# CPUSummary provides more detailed info
193-
system_data["cpu_architecture"] = CPUSummary.cpu_architecture()
207+
# Architecture info from Sys
208+
system_data["cpu_architecture"] = string(Sys.ARCH)
194209
catch
195210
system_data["cpu_architecture"] = "unknown"
196211
end
@@ -227,7 +242,7 @@ function get_detailed_system_info()
227242
end
228243

229244
try
230-
system_data["blas_num_threads"] = CPUSummary.blas_num_threads()
245+
system_data["blas_num_threads"] = LinearAlgebra.BLAS.get_num_threads()
231246
catch
232247
system_data["blas_num_threads"] = "unknown"
233248
end

0 commit comments

Comments
 (0)