CPU Identification Routines
D Makefile
Latest commit 148a277 Oct 12, 2016 @9il 9il committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
doc style fix Jul 11, 2016
source/cpuid fix docs Oct 11, 2016
.gitignore remove pragma Jul 10, 2016
.gitmodules add documentation setup Jul 9, 2016
.travis.yml update ci (#14) Oct 11, 2016
README.md Update README.md Oct 12, 2016
appveyor.yml update ci (#14) Oct 11, 2016
circle.yml change code to better C (#12) Oct 11, 2016
dub.json Update dub.json Jul 12, 2016
index.d General copyediting for consistency Jul 14, 2016

README.md

Gitter

Circle CI Build Status Build status

Dub version Dub downloads License

CPU Information

void main()
{
    import std.stdio;
    import cpuid.unified;

    cpuid_init();

    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);
}

This package also can be used as workaround for core.cpuid Issue 16028.

Documentation

See http://docs.cpuid.dlang.io .

Testing

See all reports.

To receive a report about your CPU, run

dub fetch cpuid
dub test cpuid

Please report dub log in a new GitHub issue!

See also output example.

API Features

  • API was split to unified, target specified, and vendor specified parts.
  • Complex cache topology (number of cores per cache) is supported. This feature is required by ARM CPUs.
  • Translation lookaside buffers are supported. They are used in server and math software, for example cache optimized BLAS requires TLB information.
  • Caches and TLBs are split into three types:
    • Data
    • Instruction (code)
    • Unified (data and code)
  • _cpuid function is available for x86/x86-64 targets.

Implementation Features

  • The library was written completely from scratch.
  • Code is clean and simple.
  • Unions and std.bitmanip.bitfields are used instead of bit operations.

TODO

  • Add information about recent features like AVX2, AVX512F.
  • Add information about ARM target and ARM vendors.
  • Test a lot of different CPUs.
  • Extend testing infrastructure.