| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

CPUFamily.cpp
Go to the documentation of this file.
1 /*
2 * CPUFamily.cpp
3 *
4 * Created on: Sep 23, 2010
5 */
6
13 #include <boost/python.hpp>
14
15 #define cpuid( func, ax, bx, cx, dx ) \
16 __asm__ __volatile__( "cpuid" : "=a"( ax ), "=b"( bx ), "=c"( cx ), "=d"( dx ) : "a"( func ) );
17
18 bool is_nehalem()
19 {
20 int a, b, c, d;
21 cpuid( 1, a, b, c, d );
22 int sse4_2_mask = 1 << 20;
23 return ( c & sse4_2_mask );
24 }
25
26 const char* CPUFamily()
27 {
28 if ( is_nehalem() ) {
29 return "nehalem";
30 } else {
31 return "core";
32 }
33 }
34
35 BOOST_PYTHON_MODULE( PyCPUFamily )
36 {
37 using namespace boost::python;
38 def( "CPUFamily", CPUFamily );
39 }
gaudirun.c
c
Definition: gaudirun.py:407
cpuid
#define cpuid(func, ax, bx, cx, dx)
Definition: CPUFamily.cpp:15
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(PyCPUFamily)
Definition: CPUFamily.cpp:35
is_nehalem
bool is_nehalem()
Definition: CPUFamily.cpp:18
CPUFamily
const char * CPUFamily()
Definition: CPUFamily.cpp:26
python