Boost logo

Boost :

Subject: Re: [boost] [Proposal] Adding CPUID Library in Boost
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-12-12 04:03:50


On Wed, Dec 12, 2012 at 12:53 PM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> On 12/12/12 07:45, Andrey Semashev wrote:
>
>> I'm not sure that Boost implementation should be based on an external
>> library. Libcpuid seems to be x86-only while I would prefer Boost
>> library to be easily extensible to other architectures. I know not
>> every architecture provides a cpuid-like operation but there probably
>> are other means.
>
>
> Which is why what I suggest is just part of Boost.SIMD. It is geared towards
> one thing and one thing only: detecting whether a particular SIMD extension
> is supported or not, and works across all architectures.
> There is also cache detection that we could optionally add, the code is
> already there.
>
> For reference, on other platforms you usually need to ask the operating
> system about the hardware capabilities, since detecting the capabilities can
> only be done by the kernel.

Vector programming is one of its applications, true. But hardly the
only one. Consider also atomic ops and things like AES and RDRAND.
Cache information can be useful for custom allocators. I'd rather have
a separate library that is used by Boost.SIMD or at least a highly
independent public component of Boost.SIMD (but then again, why is it
not a first class library?).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk