Commit 8c261d93 authored by Jö Fahlke's avatar Jö Fahlke

Merge branch 'ci-restrict-avx512' into 'master'

[CI] restrict to avx512

See merge request lukas.renelt/dune-vectorclass!7
parents 01dbb494 e26e039f
Pipeline #9710 failed with stage
in 6 minutes and 40 seconds
---
before_script:
- duneci-install-module https://gitlab.dune-project.org/core/dune-common.git
- duneci-install-module https://gitlab.dune-project.org/core/dune-istl.git
debian:10 gcc:c++17:
image: duneci/base:10
script: duneci-standard-test
variables: {DUNECI_OPTS: /duneci/opts.gcc.c++17}
tags: [duneci]
tags: [duneci, "iset:avx512"]
debian:9--gcc:
image: duneci/base:9
script: duneci-standard-test
tags: [duneci]
tags: [duneci, "iset:avx512"]
debian:9--clang:
image: duneci/base:9
script: duneci-standard-test
variables: {DUNECI_OPTS: /duneci/opts.clang}
tags: [duneci]
tags: [duneci, "iset:avx512"]
ubuntu:16.04--gcc:
image: duneci/base:16.04
script: duneci-standard-test
tags: [duneci]
tags: [duneci, "iset:avx512"]
ubuntu:16.04--clang:
image: duneci/base:16.04
script: duneci-standard-test
variables: {DUNECI_OPTS: /duneci/opts.clang}
tags: [duneci]
tags: [duneci, "iset:avx512"]
......@@ -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 -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 -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)
......@@ -8,7 +8,11 @@
#include <dune/common/rangeutilities.hh>
#include <dune/common/typetraits.hh> //needed for AlwaysTrue
#include <dune/common/simd/simd.hh>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#include <dune/vectorclass/upstream/vectorclass.h>
#pragma GCC diagnostic pop
namespace Dune {
namespace Simd {
......@@ -313,7 +317,7 @@ namespace Dune {
namespace MathOverloads {
template<class Vec, typename = std::enable_if_t<Simd::VectorclassImpl::IsVector<Vec>::value>>
auto isNaN(const Vec &v , PriorityTag<3>, ADLTag) {
Simd::Mask<Vec> out;
Simd::Mask<Vec> out{false};
for(auto l : range(Simd::lanes(v)))
Simd::lane(l, out) = Dune::isNaN(Simd::lane(l, v));
return out;
......@@ -321,7 +325,7 @@ namespace Dune {
template<class Vec, typename = std::enable_if_t<Simd::VectorclassImpl::IsVector<Vec>::value>>
auto isInf(const Vec &v , PriorityTag<3>, ADLTag) {
Simd::Mask<Vec> out;
Simd::Mask<Vec> out{false};
for(auto l : range(Simd::lanes(v)))
Simd::lane(l, out) = Dune::isInf(Simd::lane(l, v));
return out;
......@@ -329,7 +333,7 @@ namespace Dune {
template<class Vec, typename = std::enable_if_t<Simd::VectorclassImpl::IsVector<Vec>::value>>
auto isFinite(const Vec &v , PriorityTag<3>, ADLTag) {
Simd::Mask<Vec> out;
Simd::Mask<Vec> out{false};
for(auto l : range(Simd::lanes(v)))
Simd::lane(l, out) = Dune::isFinite(Simd::lane(l, v));
return out;
......
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