We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
julia> using Hwloc julia> function params(::Type{T}) where T micro_m = LoopVectorization.mᵣ * VectorizationBase.pick_vector_width(T) micro_n = LoopVectorization.nᵣ topology = Hwloc.topology_load() l3 = getdatacache(topology, :L3Cache) l2 = getdatacache(l3, :L2Cache) l1 = getdatacache(l2, :L1Cache) l1associativity = l1.attr.associativity l1associativity = l1associativity == 0 ? 8 : # assume 8 if unknown l1associativity == -1 ? l1.attr.size ÷ l1.attr.linesize : # fully associative l1associativity l1sets = l1.attr.size ÷ (l1.attr.linesize * l1associativity) ncachelines_per_panelA = floor(Int, (l1associativity - 1) / (1 + micro_n/micro_m)) cache_k = ncachelines_per_panelA * l1.attr.linesize * l1sets ÷ (micro_m * sizeof(T)) end params (generic function with 1 method) julia> getdatacache(topology, name) = for t in topology.children isdefined(t, :type_) || return nothing return t.type_ === name && t.attr.type_ in (:Unified, :Data) ? t : getdatacache(t, name) end getdatacache (generic function with 1 method) julia> params(Float64) 213 julia> params(Float32) 256
someone may find this code useful.
The text was updated successfully, but these errors were encountered:
This is an, uhh, interesting choice
julia> params(Float32) 76 julia> params(Float64) 76
Sorry, something went wrong.
No branches or pull requests
someone may find this code useful.
The text was updated successfully, but these errors were encountered: