Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

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.

Defines

#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.


Define 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.

00033 {
00034     using namespace boost::python;
00035     def("CPUFamily", CPUFamily);
00036 }

const char* CPUFamily (  ) 

Definition at line 24 of file CPUFamily.cpp.

00024                         {
00025     if (is_nehalem()) {
00026         return "nehalem";
00027     } else {
00028         return "core";
00029     }
00030 }

bool is_nehalem (  ) 

Definition at line 17 of file CPUFamily.cpp.

00017                   {
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 }

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

Generated at Wed Feb 9 16:28:36 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004