From: Timo Heister Date: Sat, 28 Feb 2015 22:20:20 +0000 (-0500) Subject: move EnableOpenMPSimdFor to parallel.h, update test X-Git-Tag: v8.3.0-rc1~402^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F623%2Fhead;p=dealii.git move EnableOpenMPSimdFor to parallel.h, update test - move EnableOpenMPSimdFor struct into parallel.h so it is public - use in tests/lac/intel-15-bug --- diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index 8b9fc278e6..67edaf695e 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -44,6 +44,30 @@ namespace parallel { namespace internal { + /** + * 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 + + + /** * Convert a function object of type F into an object that can be applied * to all elements of a range of synchronous iterators. diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 0c832b5904..2beda3f21a 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -48,27 +48,6 @@ 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 @@ -181,7 +160,7 @@ namespace internal void operator() (const size_type begin, const size_type end) const { - if (EnableOpenMPSimdFor::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i::value) + if (parallel::internal::EnableOpenMPSimdFor::value) { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=begin; i @@ -35,9 +36,18 @@ template void operator() (const tbb::blocked_range &range) const { + if (dealii::parallel::internal::EnableOpenMPSimdFor::value) + { DEAL_II_OPENMP_SIMD_PRAGMA for (size_type i=range.begin(); i