| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

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

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

    {
        using namespace boost::python;
        def("CPUFamily", CPUFamily);
    }

const char* CPUFamily | ( | ) |

Definition at line 24 of file CPUFamily.cpp.

                            {
        if (is_nehalem()) {
            return "nehalem";
        } else {
            return "core";
        }
    }

bool is_nehalem | ( | ) |

Definition at line 17 of file CPUFamily.cpp.

                      {
        int a,b,c,d;
        cpuid(1,a,b,c,d);
        int sse4_2_mask = 1 << 20;
        return (c & sse4_2_mask);
    }

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