File tree 3 files changed +10
-8
lines changed
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
name = " CPUSummary"
2
2
uuid = " 2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
3
3
authors = [
" chriselrod <[email protected] > and contributors" ]
4
- version = " 0.1.25 "
4
+ version = " 0.1.26 "
5
5
6
6
[deps ]
7
7
CpuId = " adafc99b-e345-5852-983c-f28acb93d879"
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ export cache_size,
35
35
# include("generic_topology.jl")
36
36
# end
37
37
# else
38
+ """
39
+ cache_size(::Val{N})
40
+
41
+ Returns the cache size per core of the `N`th cache
42
+ """
43
+ function cache_size end
44
+
38
45
if (Sys. ARCH === :x86_64 )
39
46
include (" x86.jl" )
40
47
else
Original file line number Diff line number Diff line change 26
26
end
27
27
num_l4cache () = static (0 )
28
28
29
- const PrecompiledCacheSize = CpuId. cachesize ()
29
+ const PrecompiledCacheSize = CpuId. cachesize () .÷ ( 1 , 1 , CpuId . cpucores ())
30
30
const PrecompiledCacheInclusive = CpuId. cacheinclusive ()
31
31
cache_inclusive (_) = False ()
32
32
@noinline function _eval_cache_size (cachesize)
@@ -56,12 +56,7 @@ cache_size(_) = StaticInt{0}()
56
56
57
57
# cache_size(::Union{Val{3},StaticInt{3}}) = num_cores() * StaticInt{1441792}()
58
58
function _extra_init ()
59
- nc = _get_num_cores ()
60
- if (nc != CpuId. cpucores ())
61
- cache_l3_per_core = CpuId. cachesize (3 ) ÷ max (CpuId. cpucores (), 1 )
62
- @eval cache_size (:: Union{Val{3},StaticInt{3}} ) = $ (static (cache_l3_per_core * nc))
63
- end
64
- cs = CpuId. cachesize ()
59
+ cs = CpuId. cachesize () .÷ (1 , 1 , CpuId. cpucores ())
65
60
cs === PrecompiledCacheSize || _eval_cache_size (cs)
66
61
ci = CpuId. cacheinclusive ()
67
62
ci === PrecompiledCacheInclusive || _eval_cache_inclusive (ci)
You can’t perform that action at this time.
0 commit comments