| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

# CPUFamily.cpp

Go to the documentation of this file.

    00001 /*
    00002  * CPUFamily.cpp
    00003  *
    00004  *  Created on: Sep 23, 2010
    00005  */
    00006
    00013 #include <boost/python.hpp>
    00014
    00015 #define cpuid(func,ax,bx,cx,dx) __asm__ __volatile__ ("cpuid": "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));
    00016
    00017 bool is_nehalem() {
    00018     int a,b,c,d;
    00019     cpuid(1,a,b,c,d);
    00020     int sse4_2_mask = 1 << 20;
    00021     return (c & sse4_2_mask);
    00022 }
    00023
    00024 const char* CPUFamily() {
    00025     if (is_nehalem()) {
    00026         return "nehalem";
    00027     } else {
    00028         return "core";
    00029     }
    00030 }
    00031
    00032 BOOST_PYTHON_MODULE(PyCPUFamily)
    00033 {
    00034     using namespace boost::python;
    00035     def("CPUFamily", CPUFamily);
    00036 }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines