From 197f3a10564e93b2cd90bcee6e104e904ef79d80 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 26 Feb 2015 09:14:11 -0500 Subject: [PATCH] Disable SIMD vector operations for certain types Disable long double SIMD instructions on ICC. This is to work around a bug that generates wrong code at least up to intel 15 (see tests/lac /vector-vector, tests/lac/intel-15-bug, and the discussion at https://github.com/dealii/dealii/issues/598). --- include/deal.II/lac/vector.templates.h | 218 ++++++++++++++++++++----- 1 file changed, 176 insertions(+), 42 deletions(-) diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 942f1f9cbd..72a65c7e17 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -48,6 +48,28 @@ DEAL_II_NAMESPACE_OPEN +/** + * Helper struct to tell us if we can use SIMD instructions for the given @p + * Number type. + */ +template +struct EnableOpenMPSimdFor +{ + static const bool value = true; +}; + +#ifdef __INTEL_COMPILER +// Disable long double SIMD instructions on ICC. This is to work around a bug +// that generates wrong code at least up to intel 15 (see +// tests/lac/vector-vector, tests/lac/intel-15-bug, and the discussion at +// https://github.com/dealii/dealii/issues/598). +template <> +struct EnableOpenMPSimdFor +{ + static const bool value = false; +}; +#endif + namespace internal { @@ -159,9 +181,17 @@ namespace internal void operator() (const size_type begin, const size_type end) const { - DEAL_II_OPENMP_SIMD_PRAGMA - for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i::value) + { + DEAL_II_OPENMP_SIMD_PRAGMA + for (size_type i=begin; i