The Gaudi Framework  master (da3d77e1)
instructionsetLevel.cpp File Reference
#include <GaudiKernel/System.h>
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for instructionsetLevel.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 24 of file instructionsetLevel.cpp.

24  {
25 
26  // These names are those reported in flags field of /proc/cpuinfo on Linux
27  // See arch/x86/include/asm/cpufeature.h
28  const std::vector<std::string> sets{ // "80386",
29  "sse", "sse2",
30  "sse3", // Note: This is reported by Linux as 'pni'
31  "ssse3", "sse4_1", "sse4_2", "avx", "avx2", "avx512f", "avx512vl" };
32 
33  if ( argc == 1 ) {
35  if ( level < sets.size() ) {
36  for ( int i = level; i >= 0; --i ) { std::cout << sets[i] << std::endl; }
37  } else {
38  std::cout << "unknown instruction set level: " << level << std::endl;
39  return 2;
40  }
41  } else if ( ( argc == 2 ) && ( std::string{ "all" } == std::string{ argv[1] } ) ) {
42  for ( auto& s : sets ) std::cout << s << std::endl;
43  } else {
44  std::cout << "Error: wrong arguments\nUsage:\n\t" << argv[0] << " [all]" << std::endl;
45  return 1;
46  }
47 
48  return 0;
49 }
std::string
STL class.
plotBacklogPyRoot.argc
argc
Definition: plotBacklogPyRoot.py:173
gaudirun.s
string s
Definition: gaudirun.py:346
std::vector< std::string >
System::instructionsetLevel
GAUDI_API int instructionsetLevel()
Instruction Set "Level".
Definition: System.cpp:343
std::cout
gaudirun.level
level
Definition: gaudirun.py:364
std::endl
T endl(T... args)
std::size_t
gaudirun.argv
list argv
Definition: gaudirun.py:327