GithubHelp home page GithubHelp logo

isabella232 / mir-cpuid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libmir/mir-cpuid

0.0 0.0 0.0 146 KB

BetterC CPU Identification Routines

Home Page: http://mir-cpuid.libmir.org

D 97.32% Makefile 1.10% Meson 1.58%

mir-cpuid's Introduction

Gitter

Build Status Build Status

Dub version Dub downloads License

CPU Information

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

    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

http://mir-cpuid.libmir.org

Testing

See all reports.

Run the following command from the project's directory to receive a report about your CPU

dub --single report.d

Please report dub log in a new GitHub issue!

See also output example.

Building a betterC library

BetterC mode works when compiled with LDC only.

dub build --compiler=ldmd2 --build-mode=singleFile --parallel

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 mir.bitmanip.bitfields are used instead of bit operations.
  • Slim betterC library with extern(C) insterface.

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.
  • CPU(package) count identification.
  • Per CPU(package) CPUID information.

mir-cpuid's People

Contributors

9il avatar britishempire avatar n8sh avatar wilzbach avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.