The Gaudi Framework
v26r1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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) __asm__ __volatile__ ("cpuid": "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));
16
17
bool
is_nehalem
() {
18
int
a,b,
c
,d;
19
cpuid
(1,a,b,c,d);
20
int
sse4_2_mask = 1 << 20;
21
return
(c & sse4_2_mask);
22
}
23
24
const
char
*
CPUFamily
() {
25
if
(
is_nehalem
()) {
26
return
"nehalem"
;
27
}
else
{
28
return
"core"
;
29
}
30
}
31
32
BOOST_PYTHON_MODULE
(PyCPUFamily)
33
{
34
using namespace
boost::python;
35
def(
"CPUFamily"
,
CPUFamily
);
36
}
GaudiProfiling
src
python
CPUFamily.cpp
Generated on Mon Feb 16 2015 11:56:57 for The Gaudi Framework by
1.8.2