Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

CPUFamily.cpp

Go to the documentation of this file.
00001 /*
00002  * CPUFamily.cpp
00003  *
00004  *  Created on: Sep 23, 2010
00005  */
00006 
00013 #include <boost/python.hpp>
00014 
00015 #define cpuid(func,ax,bx,cx,dx) __asm__ __volatile__ ("cpuid": "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));
00016 
00017 bool is_nehalem() {
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 }
00023 
00024 const char* CPUFamily() {
00025     if (is_nehalem()) {
00026         return "nehalem";
00027     } else {
00028         return "core";
00029     }
00030 }
00031 
00032 BOOST_PYTHON_MODULE(PyCPUFamily)
00033 {
00034     using namespace boost::python;
00035     def("CPUFamily", CPUFamily);
00036 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

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