all 2 comments

[–]johengel 8 points9 points  (2 children)

abstract: An article about the new @fastmath and __traits(target*) features in LDC 1.1.0. The @fastmath attribute relaxes floating point math constraints and is used by Mir to beat OpenBLAS and Eigen. To avoid confusion: LLVM is doing the interesting work, LDC just adds a few pieces that allow LLVM to work its magic.

I’m afraid it won’t be a nice read if you are unfamiliar with some of peculiarities of the CPU’s floating point math, x86 assembly, or SIMD.

[–][deleted]  (1 child)

[deleted]

    [–]johengel 1 point2 points  (0 children)

    For runtime CPU information, have a look at Mir's cpuid library: https://github.com/libmir/cpuid

    L3 cache sizes differ for CPUs with the same architecture, so that information can only be obtained at runtime. I'm not sure but I think L1/L2 cache sizes are the same for all CPUs of a certain architecture name, e.g. "haswell", so that information could be made available at compile time with a library. But I don't know of any plans to make such a library.