Le 25/10/2012 23:57, Robin Scher a écrit :
On OS-X, you can get this string from the sysctlbyname() call:

    const char *name = "machdep.cpu.brand_string";
    char buffer[ 64 ];
    size_t size = 64;
    if( !sysctlbyname( name, buffer, &size, NULL, 0 ) )
        memcpy( cpu_model, buffer, 12 * sizeof( int ) );


if That doesn't work, you can get it from calling system_profiler and parsing the output.

I'd rather not do that from inside the hwloc library :)

On Widows (32 bit), the only way I've found is to actually use the cpuid assembly call:

Good to know, that's likely similar to the Linux code I cited in my other mail.
I'll see if I can put that in some sort of common code.

I don't know if that would work on Win64, though. Do you think those could be added to hwloc?

If we can make this work without too much pain, sure.