Skip to content

Commit

Permalink
Fix a bug in navigating Hwloc's topology.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Dec 14, 2020
1 parent 95935bb commit dd7bfcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "VectorizationBase"
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
authors = ["Chris Elrod <elrodc@gmail.com>"]
version = "0.13.11"
version = "0.13.12"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
25 changes: 8 additions & 17 deletions src/topology.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


const TOPOLOGY = Hwloc.topology_load();
const CACHE = TOPOLOGY.children[1].children[1];
const COUNTS = Hwloc.histmap(TOPOLOGY);
Expand All @@ -26,16 +25,14 @@ function define_cache(N)
type = nothing
)
end
c = CACHE
for n 1:CACHE_LEVELS-N
c = first(c.children)
end
cache_name = (:L1Cache, :L2Cache, :L3Cache, :L4Cache)[N]
c = first(t for t in TOPOLOGY if t.type_ == cache_name && t.attr.depth == N).attr
(
size = c.attr.size,
depth = c.attr.depth,
linesize = c.attr.linesize,
associativity = c.attr.associativity,
type = c.attr.type_
size = c.size,
depth = c.depth,
linesize = c.linesize,
associativity = c.associativity,
type = c.type_
)
end

Expand All @@ -45,18 +42,12 @@ const L₂CACHE = define_cache(2)
const L₃CACHE = define_cache(3)
const L₄CACHE = define_cache(4)
"""
L₁, L₂, L₃ cache size
L₁, L₂, L₃, L₄ cache size
"""
const CACHE_SIZE = (
L₁CACHE.size,
L₂CACHE.size,
L₃CACHE.size,
L₄CACHE.size
)
# const CACHE_NEST_COUNT = (
# length(CACHE.children[1].children),
# length(CACHE.children),
# length(TOPOLOGY.children[1].children)
# )


2 comments on commit dd7bfcd

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/26368

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.13.12 -m "<description of version>" dd7bfcd45e2b4d488e2db79cda92ef564b1c75d8
git push origin v0.13.12

Please sign in to comment.