m-j-w / CpuId.jl

Ask the CPU for cache sizes, SIMD feature support, a running hypervisor, and more.
Other
54 stars 10 forks source link

`Sys.CPU_CORES` was renamed in Julia 1.0 #42

Closed DilumAluthge closed 3 years ago

DilumAluthge commented 3 years ago

The docstring for CpuId.cpucores says:

help?> CpuId.cpucores
  cpucores()

  Determine the number of physical cores on the current executing CPU by invoking a
  cpuid instruction. On systems with multiple CPUs, this only gives information on the
  single CPU that is executing the code. Returns zero if querying this feature is not
  supported, which may also be due to a running hypervisor (as observed on hvvendor() ==
  :Microsoft).

  Also, this function does not take logical cores (aka hyperthreading) into account, but
  determines the true number of physical cores, which typically also share L3 caches and
  main memory bandwidth.

  See also the Julia global variable Base.Sys.CPU_CORES, which gives the total count of
  all cores on the machine.

However, as of Julia 1.0, Sys.CPU_CORES has been renamed to Sys.CPU_THREADS (see https://github.com/JuliaLang/julia/pull/27856, https://github.com/JuliaLang/julia/pull/28091, and https://github.com/JuliaLang/julia/commit/1f1b1b8c4e27668efddcaceb59db9422bb274cfd).

Should the docstring be updated?

m-j-w commented 3 years ago

Good catch. Resolved in merged #44