From: Martin Kronbichler Date: Mon, 2 Mar 2015 14:31:47 +0000 (+0100) Subject: Work around bug in clang-3.6 with AVX. X-Git-Tag: v8.3.0-rc1~397^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e202d35360b826536d3ac7b75fa535a84db601c3;p=dealii.git Work around bug in clang-3.6 with AVX. --- diff --git a/cmake/checks/check_01_cpu_features.cmake b/cmake/checks/check_01_cpu_features.cmake index 480f5ff085..6d7c466f82 100644 --- a/cmake/checks/check_01_cpu_features.cmake +++ b/cmake/checks/check_01_cpu_features.cmake @@ -109,9 +109,32 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) " DEAL_II_HAVE_SSE2) + # + # clang-3.6.0 has a bug in operator+ on two VectorizedArray components as + # defined in deal.II. Therefore, the test for AVX needs to also test for + # operator+ to be correctly implemented. + # CHECK_CXX_SOURCE_RUNS( " #include + class VectorizedArray + { + public: + VectorizedArray & + operator += (const VectorizedArray &vec) + { + data = _mm256_add_pd (data, vec.data); + return *this; + } + __m256d data; + }; + inline + VectorizedArray + operator + (const VectorizedArray &u, const VectorizedArray &v) + { + VectorizedArray tmp = u; + return tmp+=v; + } int main() { __m256d a, b; @@ -133,6 +156,14 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) for (int i=1; i(&e.data); + for (int i=0; i