| The Gaudi Framework v27r1

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

- File List
- File Members

Macros | Functions
CPUFamily.cpp File Reference

Python module to be able to check the processor family (Core/Nehalem) More...

`#include <boost/python.hpp>`
Include dependency graph for CPUFamily.cpp:

Go to the source code of this file.

## Macros
#define | cpuid(func, ax, bx, cx, dx) __asm__ __volatile__ ("cpuid": "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));

## Functions
bool | is_nehalem ()
const char * | CPUFamily ()
| BOOST_PYTHON_MODULE (PyCPUFamily)

## Detailed Description

Python module to be able to check the processor family (Core/Nehalem)

Definition in file CPUFamily.cpp.

## Macro Definition Documentation

#define cpuid | ( |  | func,
|  |  | ax,
|  |  | bx,
|  |  | cx,
|  |  | dx
| ) |  | __asm__ __volatile__ ("cpuid": "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));

Definition at line 15 of file CPUFamily.cpp.

## Function Documentation

BOOST_PYTHON_MODULE | ( | PyCPUFamily |  | ) |

Definition at line 32 of file CPUFamily.cpp.

33 {
34 using namespace boost::python;
35 def("CPUFamily", CPUFamily);
36 }
CPUFamily
const char * CPUFamily()
Definition: CPUFamily.cpp:24
python

const char* CPUFamily | ( |  | ) |

Definition at line 24 of file CPUFamily.cpp.

24 {
25 if (is_nehalem()) {
26 return "nehalem";
27 } else {
28 return "core";
29 }
30 }
is_nehalem
bool is_nehalem()
Definition: CPUFamily.cpp:17

bool is_nehalem | ( |  | ) |

Definition at line 17 of file CPUFamily.cpp.

17 {
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 }
gaudirun.c
tuple c
Definition: gaudirun.py:391
cpuid
#define cpuid(func, ax, bx, cx, dx)
Definition: CPUFamily.cpp:15