Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v31r0 (aeb156f0)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
instructionsetLevel.cpp
Go to the documentation of this file.
1
/*
2
* instructionsetLevel.cpp
3
*
4
* Created on: Feb 3, 2015
5
* Author: Marco Clemencic
6
*/
7
8
#include <
GaudiKernel/System.h
>
9
10
#include <iostream>
11
#include <string>
12
#include <vector>
13
14
int
main
(
int
argc
,
char
*
argv
[] ) {
15
16
// These names are those reported in flags field of /proc/cpuinfo on Linux
17
// See arch/x86/include/asm/cpufeature.h
18
std::vector<std::string>
sets{
19
// "80386",
20
"sse"
,
"sse2"
,
21
"sse3"
,
// FIXME: This is not reported by Linux (?)
22
"ssse3"
,
"sse4_1"
,
"sse4_2"
,
"avx"
,
"avx2"
,
23
"avx512f"
// FIXME: This is not reported by Linux (?)
24
};
25
26
if
( argc == 1 ) {
27
size_t
level
=
System::instructionsetLevel
() - 1;
28
if
( level < sets.size() )
29
for
(
int
i =
System::instructionsetLevel
() - 1; i >= 0; --i ) {
std::cout
<< sets[i] <<
std::endl
; }
30
else
{
31
std::cout
<<
"unknown instruction set level: "
<< level <<
std::endl
;
32
return
2;
33
}
34
}
else
if
( ( argc == 2 ) && (
std::string
{
"all"
} ==
std::string
{argv[1]} ) ) {
35
for
(
auto
&
s
: sets )
std::cout
<<
s
<<
std::endl
;
36
}
else
{
37
std::cout
<<
"Error: wrong arguments\nUsage:\n\t"
<< argv[0] <<
" [all]"
<<
std::endl
;
38
return
1;
39
}
40
41
return
0;
42
}
System.h
gaudirun.argv
list argv
Definition:
gaudirun.py:294
System::instructionsetLevel
GAUDI_API int instructionsetLevel()
Instruction Set "Level".
Definition:
System.cpp:337
std::endl
T endl(T...args)
std::string
STL class.
plotBacklogPyRoot.argc
argc
Definition:
plotBacklogPyRoot.py:142
main
int main(int argc, char *argv[])
Definition:
instructionsetLevel.cpp:14
std::vector< std::string >
gaudirun.s
string s
Definition:
gaudirun.py:312
gaudirun.level
level
Definition:
gaudirun.py:330
std::cout
GaudiKernel
src
Util
instructionsetLevel.cpp
Generated on Mon Feb 11 2019 17:48:17 for The Gaudi Framework by
1.8.11