On Tuesday, August 16, 2016 at 1:41:54 PM UTC, Erik Schnetter wrote:
>
> ```Julia
> Pkg.add("Hwloc")
> using Hwloc
> topo = load_topology()
> print(topo)
> ```
>
> I just see that Hwloc has problems with Julia 0.5; I'll tag a new release.
>Great to know about the hwloc package and its wrapper (I was going to post some links on dynamically finding out.. or statically for Linux) . I did notice however: "Remove non-functional Windows support <https://github.com/JuliaParallel/Hwloc.jl/commit/5cc4f3c3bd20237f82a6ad300b5df94c8d2798b5>" (just in the wrapper, the base library supports Windows, so you could add suport.. and that commit helps knowing how). [I didn't check FreeBSD (or OS X) support, is it compatible with Linux?] I was looking into this myself a while back (and getting cache-line size). I guess a default fallback of at least 4 KB, possibly 32 KB, might be ok (and 16-byte cache lines, probably save and lowest/most common size) on case your library finds nothing, e.g. on Windows. [BLAS is compiled, I think with cache knowledge, maybe there's a way of knowing dynamically with what options? I guess not good to rely on, think it's stipped out in Julia-lite branch.] [I was also thinking ahead to AOT compiled Julia.. be aware of that also.. when cross-compiling Julia and C++ would seem to have to be conservative, one reason Julia seems better than C++ (even without AOT).] See here for save lowest-L1 size you want to support (I've never heard of lower than 4 KB data, all shared code+data gone and also where 4 KB): https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures >is there a (cross-platform) way to get the CPU L1 cache size You assume you have a [L1] cache..? :) My/the first ARM had none.. than came 4 KB (shared, later split and more than L1). Yes, all computers in decades have a cache, except for newest fastest TOP500 supercomputer (scratchpad, Adapteva's CPU similar) and Tera had just many threads.. -- Palli. > > -erik > > > On Tue, Aug 16, 2016 at 5:12 AM, Oliver Schulz <[email protected] > <javascript:>> wrote: > >> Hi, >> >> is there a (cross-platform) way to get the CPU L1 cache size from Julia? >> I'd like to determine the optimal block size(s) for an array algorithm. >> >> >> Cheers, >> >> Oliver >> >> > > > -- > Erik Schnetter <[email protected] <javascript:>> > http://www.perimeterinstitute.ca/personal/eschnetter/ >
