The OpenD Programming Language

cpuid.unified

High level abstraction on top of all architectures.

$(GREEN This module is compatible with betterC compilation mode.)

Public Imports

cpuid.common
public import cpuid.common;
Undocumented in source.

Members

Aliases

cores
alias cores = mir_cpuid_cores

Total number of cores per CPU.

cpuid_init
alias cpuid_init = mir_cpuid_init

Initialize basic CPU information including basic architecture. It is safe to call this function multiple times. It calls appropriate basic initialization for each module (cpuid_x86_any_init for X86 machines).

cpus
alias cpus = mir_cpuid_cpus

Total number of CPU packages. Note: not implemented

dCache
alias dCache = mir_cpuid_dCache

Data Caches

dTlb
alias dTlb = mir_cpuid_dTlb

Data Translation Lookaside Buffers

iCache
alias iCache = mir_cpuid_iCache

Instruction Caches

iTlb
alias iTlb = mir_cpuid_iTlb

Instruction Translation Lookaside Buffers

threads
alias threads = mir_cpuid_threads

Total number of threads per CPU.

uCache
alias uCache = mir_cpuid_uCache

Unified Caches

uTlb
alias uTlb = mir_cpuid_uTlb

Unified Translation Lookaside Buffers

Functions

mir_cpuid_cores
uint mir_cpuid_cores()

Total number of cores per CPU.

mir_cpuid_cpus
uint mir_cpuid_cpus()

Total number of CPU packages. Note: not implemented

mir_cpuid_dCache
immutable(Cache)[] mir_cpuid_dCache()

Data Caches

mir_cpuid_dTlb
immutable(Tlb)[] mir_cpuid_dTlb()

Data Translation Lookaside Buffers

mir_cpuid_iCache
immutable(Cache)[] mir_cpuid_iCache()

Instruction Caches

mir_cpuid_iTlb
immutable(Tlb)[] mir_cpuid_iTlb()

Instruction Translation Lookaside Buffers

mir_cpuid_init
void mir_cpuid_init()

Initialize basic CPU information including basic architecture. It is safe to call this function multiple times. It calls appropriate basic initialization for each module (cpuid_x86_any_init for X86 machines).

mir_cpuid_threads
uint mir_cpuid_threads()

Total number of threads per CPU.

mir_cpuid_uCache
immutable(Cache)[] mir_cpuid_uCache()

Unified Caches

mir_cpuid_uTlb
immutable(Tlb)[] mir_cpuid_uTlb()

Unified Translation Lookaside Buffers

Examples

void smallReport()
{
    import cpuid.unified;

    import std.stdio: writefln;
    enum fmt = "%14s: %s";

    fmt.writefln("cores", cores);
    fmt.writefln("threads", threads);

    fmt.writefln("data caches", dCache.length);
    fmt.writefln("code caches", iCache.length);
    fmt.writefln("unified caches", uCache.length);

    fmt.writefln("data TLBs", dTlb.length);
    fmt.writefln("code TLBs", iTlb.length);
    fmt.writefln("unified TLBs", uTlb.length);
}

Meta

Authors

Ilia Ki