Skip to content

Commit a9f6050

Browse files
Update generic_topology.jl
1 parent 905d768 commit a9f6050

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/generic_topology.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
num_machines() = static(1)
33
num_sockets() = static(1)
44

5-
_get_num_cores() = (get_cpu_threads())::Int >> (Sys.ARCH !== :aarch64)
5+
const syst = @load_preference("syst", get_cpu_threads())
6+
const nc = @load_preference("nc", syst >> (Sys.ARCH !== :aarch64))
7+
8+
_get_num_cores() = nc
9+
num_l1cache() = static(nc)
10+
num_cores() = static(nc)
11+
sys_threads() = static(syst)
612

7-
let syst = static(get_cpu_threads()), nc = static(syst >> (Sys.ARCH !== :aarch64))
8-
global num_l1cache() = nc
9-
global num_cores() = nc
10-
global sys_threads() = syst
11-
end
1213
@static if Sys.ARCH === :aarch64
1314
num_l2cache() = static(1)
1415
num_l3cache() = static(0)

0 commit comments

Comments
 (0)