Commit e26e039f authored by Jö Fahlke's avatar Jö Fahlke

Fix compiler flags for avx512.

Compilers seem to have prblems generating correct code unless all
sub-instructionsets for skylake-avx512 are enabled.  On the other hand,
Ubuntu 16.04 does not yet support -march=skylake-avx512, so we cannot simply
use that.
parent 5b5ffb2f
Pipeline #9709 failed with stage
in 6 minutes and 33 seconds
......@@ -3,6 +3,16 @@ include(DuneInstance)
set(MAX_VECTOR_SIZE 512)
set(SSE2_COMPILE_FLAGS) # implicit in x86_64
set(AVX_COMPILE_FLAGS -mavx)
set(AVX2_COMPILE_FLAGS -mavx -mavx2 -mfma)
#set(AVX512_COMPILE_FLAGS -march=skylake-avx512)
# The above is not supported on Ubuntu 16.04 yet so use the below explicit flags
set(AVX512_COMPILE_FLAGS
-mavx -mavx2 -mfma
-mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl)
dune_instance_begin(FILES vectorclasstest.hh vectorclasstest.cc)
foreach(VECTOR_SIZE IN ITEMS 128 256 512)
......@@ -25,62 +35,21 @@ dune_instance_end()
dune_list_filter(DUNE_INSTANCE_GENERATED INCLUDE REGEX [[\.cc$]])
dune_add_test(NAME vectorclasstest-sse
SOURCES ${DUNE_INSTANCE_GENERATED}
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -msse2
LINK_LIBRARIES dunecommon
)
dune_add_test(NAME vectorclasstest-avx
SOURCES ${DUNE_INSTANCE_GENERATED}
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -mavx
LINK_LIBRARIES dunecommon
)
dune_add_test(NAME vectorclasstest-avx2
SOURCES ${DUNE_INSTANCE_GENERATED}
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -mavx2 -mfma
LINK_LIBRARIES dunecommon
)
dune_add_test(NAME vectorclasstest-avx512
SOURCES ${DUNE_INSTANCE_GENERATED}
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -mavx512f -mavx512cd -mavx512vl -mfma
LINK_LIBRARIES dunecommon
)
dune_add_test(NAME multirhstest-sse
SOURCES multirhstest.cc
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -msse2
LINK_LIBRARIES dunecommon
CMAKE_GUARD dune-istl_FOUND
)
dune_add_test(NAME multirhstest-avx
SOURCES multirhstest.cc
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -mavx
LINK_LIBRARIES dunecommon
CMAKE_GUARD dune-istl_FOUND
)
dune_add_test(NAME multirhstest-avx2
SOURCES multirhstest.cc
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -mavx2 -mfma
LINK_LIBRARIES dunecommon
CMAKE_GUARD dune-istl_FOUND
)
dune_add_test(NAME multirhstest-avx512
SOURCES multirhstest.cc
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS -mavx512f -mavx512cd -mavx512vl -mfma
LINK_LIBRARIES dunecommon
CMAKE_GUARD dune-istl_FOUND
)
foreach(iset IN ITEMS sse2 avx avx2 avx512)
string(TOUPPER "${iset}" ISET)
dune_add_test(NAME vectorclasstest-${iset}
SOURCES ${DUNE_INSTANCE_GENERATED}
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS ${${ISET}_COMPILE_FLAGS}
LINK_LIBRARIES dunecommon
)
dune_add_test(NAME multirhstest-${iset}
SOURCES multirhstest.cc
COMPILE_DEFINITIONS -DMAX_VECTOR_SIZE=${MAX_VECTOR_SIZE}
COMPILE_FLAGS ${${ISET}_COMPILE_FLAGS}
LINK_LIBRARIES dunecommon
CMAKE_GUARD dune-istl_FOUND
)
endforeach(iset)
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