Gaudi Framework, version v24r2
Home
Generated: Wed Dec 4 2013
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
GaudiProfiling
src
python
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
}
Generated at Wed Dec 4 2013 14:33:10 for Gaudi Framework, version v24r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004