Commit 1e69f8d4 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

GaudiKernel instructionsetLevel: Add additional AVX512 levels (!954)

parents 8fa2dd81 483006c4
......@@ -15,19 +15,16 @@ int main( int argc, char* argv[] ) {
// These names are those reported in flags field of /proc/cpuinfo on Linux
// See arch/x86/include/asm/cpufeature.h
std::vector<std::string> sets{
// "80386",
"sse", "sse2",
"sse3", // FIXME: This is not reported by Linux (?)
"ssse3", "sse4_1", "sse4_2", "avx", "avx2",
"avx512f" // FIXME: This is not reported by Linux (?)
};
const std::vector<std::string> sets{// "80386",
"sse", "sse2",
"sse3", // Note: This is reported by Linux as 'pni'
"ssse3", "sse4_1", "sse4_2", "avx", "avx2", "avx512f", "avx512vl", "avx512bw"};
if ( argc == 1 ) {
size_t level = System::instructionsetLevel() - 1;
if ( level < sets.size() )
for ( int i = System::instructionsetLevel() - 1; i >= 0; --i ) { std::cout << sets[i] << std::endl; }
else {
const std::size_t level = System::instructionsetLevel() - 1;
if ( level < sets.size() ) {
for ( int i = level; i >= 0; --i ) { std::cout << sets[i] << std::endl; }
} else {
std::cout << "unknown instruction set level: " << level << std::endl;
return 2;
}
......
......@@ -11,13 +11,14 @@ def test():
expected = set()
for l in open('/proc/cpuinfo'):
if l.startswith('flags'):
expected = set(l.strip().split()).intersection(known_flags)
flags = set(l.strip().split())
if 'pni' in flags:
flags.add('sse3')
expected = flags.intersection(known_flags)
break
out = Popen(['instructionsetLevel.exe'], stdout=PIPE).communicate()[0]
out = out.decode('utf-8')
found = set(l.strip() for l in out.splitlines())
# FIXME: these seem not to be reported by Linux
found -= set(['sse3', 'avx512f'])
assert expected == found, ('expected: {0}, found: {1}'.format(
sorted(expected), sorted(found)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment