jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
jau::cpu::CpuInfo Class Reference

Singleton CpuInfo caching all jau::cpu information. More...

#include <cpuid.hpp>

Collaboration diagram for jau::cpu::CpuInfo:

Public Member Functions

 CpuInfo (const CpuInfo &)=delete
 
size_t online_core_count () const noexcept
 Returns maximum number of available/online cores, i.e. More...
 
void operator= (const CpuInfo &)=delete
 
std::string toString () const noexcept
 
std::string toString (std::string &sb, bool details_only=false) const noexcept
 

Static Public Member Functions

static const CpuInfoget () noexcept
 Returns reference to const singleton instance. More...
 

Public Attributes

arm32_hwcap1_t arm32_hwcap1
 arm32_hwcap1_t info if available, i.e. More...
 
arm32_hwcap2_t arm32_hwcap2
 arm32_hwcap2_t info if available, i.e. More...
 
arm64_hwcap_t arm64_hwcap
 arm64_hwcap_t info if available, i.e. More...
 
jau::endian_t byte_order
 
size_t concurrent_threads
 Number of available concurrent threads (cores) or zero if information is not available, using C++11 std::thread::hardware_concurrency() More...
 
cpu_family_t family
 cpu_family_t derived from Architectures predefined compiler macros. More...
 
bool has_arm32_hwcap
 True if successfully queried arm32_hwcap1 and arm32_hwcap1 on cpu_family_t::arm32. More...
 
bool has_arm64_hwcap
 True if successfully queried arm64_hwcap on cpu_family_t::arm64. More...
 
bool has_l1_minmax
 True if successfully queried l1_share_max and l1_apart_min. More...
 
size_t l1_apart_min
 Minimum offset between two objects to avoid false sharing if has_l1_minmax, or zero. More...
 
size_t l1_share_max
 Maximum size of contiguous memory to promote true sharing if has_l1_minmax, or zero. More...
 
size_t page_size
 Size of a page in bytes or zero if not available. More...
 
size_t pointer_bits
 See pointer_bit_size() More...
 
size_t sys_max_cores
 Number of installed/configured cores from system call. More...
 
size_t sys_online_cores
 Number of available/online cores from system call. More...
 

Detailed Description

Singleton CpuInfo caching all jau::cpu information.

Definition at line 316 of file cpuid.hpp.

Constructor & Destructor Documentation

◆ CpuInfo()

jau::cpu::CpuInfo::CpuInfo ( const CpuInfo )
delete

Member Function Documentation

◆ operator=()

void jau::cpu::CpuInfo::operator= ( const CpuInfo )
delete

◆ get()

static const CpuInfo & jau::cpu::CpuInfo::get ( )
inlinestaticnoexcept

Returns reference to const singleton instance.

Definition at line 356 of file cpuid.hpp.

Here is the caller graph for this function:

◆ online_core_count()

size_t jau::cpu::CpuInfo::online_core_count ( ) const
inlinenoexcept

Returns maximum number of available/online cores, i.e.

max(sys_online_cores, concurrent_threads).

Definition at line 362 of file cpuid.hpp.

◆ toString() [1/2]

std::string jau::cpu::CpuInfo::toString ( std::string &  sb,
bool  details_only = false 
) const
noexcept

Definition at line 393 of file cpuid.cpp.

Here is the caller graph for this function:

◆ toString() [2/2]

std::string jau::cpu::CpuInfo::toString ( ) const
inlinenoexcept

Definition at line 367 of file cpuid.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ pointer_bits

size_t jau::cpu::CpuInfo::pointer_bits

See pointer_bit_size()

Definition at line 319 of file cpuid.hpp.

◆ page_size

size_t jau::cpu::CpuInfo::page_size

Size of a page in bytes or zero if not available.

Definition at line 321 of file cpuid.hpp.

◆ has_l1_minmax

bool jau::cpu::CpuInfo::has_l1_minmax

True if successfully queried l1_share_max and l1_apart_min.

Definition at line 323 of file cpuid.hpp.

◆ l1_share_max

size_t jau::cpu::CpuInfo::l1_share_max

Maximum size of contiguous memory to promote true sharing if has_l1_minmax, or zero.

Definition at line 325 of file cpuid.hpp.

◆ l1_apart_min

size_t jau::cpu::CpuInfo::l1_apart_min

Minimum offset between two objects to avoid false sharing if has_l1_minmax, or zero.

Definition at line 327 of file cpuid.hpp.

◆ concurrent_threads

size_t jau::cpu::CpuInfo::concurrent_threads

Number of available concurrent threads (cores) or zero if information is not available, using C++11 std::thread::hardware_concurrency()

Definition at line 329 of file cpuid.hpp.

◆ sys_online_cores

size_t jau::cpu::CpuInfo::sys_online_cores

Number of available/online cores from system call.

Definition at line 331 of file cpuid.hpp.

◆ sys_max_cores

size_t jau::cpu::CpuInfo::sys_max_cores

Number of installed/configured cores from system call.

Definition at line 333 of file cpuid.hpp.

◆ family

cpu_family_t jau::cpu::CpuInfo::family

cpu_family_t derived from Architectures predefined compiler macros.

Definition at line 335 of file cpuid.hpp.

◆ byte_order

jau::endian_t jau::cpu::CpuInfo::byte_order

Definition at line 336 of file cpuid.hpp.

◆ has_arm32_hwcap

bool jau::cpu::CpuInfo::has_arm32_hwcap

True if successfully queried arm32_hwcap1 and arm32_hwcap1 on cpu_family_t::arm32.

Definition at line 338 of file cpuid.hpp.

◆ arm32_hwcap1

arm32_hwcap1_t jau::cpu::CpuInfo::arm32_hwcap1

arm32_hwcap1_t info if available, i.e.

has_arm32_hwcap

Definition at line 340 of file cpuid.hpp.

◆ arm32_hwcap2

arm32_hwcap2_t jau::cpu::CpuInfo::arm32_hwcap2

arm32_hwcap2_t info if available, i.e.

has_arm32_hwcap

Definition at line 342 of file cpuid.hpp.

◆ has_arm64_hwcap

bool jau::cpu::CpuInfo::has_arm64_hwcap

True if successfully queried arm64_hwcap on cpu_family_t::arm64.

Definition at line 344 of file cpuid.hpp.

◆ arm64_hwcap

arm64_hwcap_t jau::cpu::CpuInfo::arm64_hwcap

arm64_hwcap_t info if available, i.e.

has_arm64_hwcap

Definition at line 346 of file cpuid.hpp.


The documentation for this class was generated from the following files: