diff options
author | 2008-04-11 14:28:42 +0000 | |
---|---|---|
committer | 2008-04-11 14:28:42 +0000 | |
commit | dcebc46cdcd29fa65449c6d3215f30a28ec0a8c8 (patch) | |
tree | 1e623df72a481574dc523ef096b4a979ebe1b2a9 /Eigen/src/Core/util/Macros.h | |
parent | 7bee90a62a0e5fec52a4b8a6f0b1d88c175d63f8 (diff) |
- cleaner use of OpenMP (no code duplication anymore)
using a macro and _Pragma.
- use OpenMP also in cacheOptimalProduct and in the
vectorized paths as well
- kill the vector assignment unroller. implement in
operator= the logic for assigning a row-vector in
a col-vector.
- CMakeLists support for building tests/examples
with -fopenmp and/or -msse2
- updates in bench/, especially replace identity()
by ones() which prevents underflows from perturbing
bench results.
Diffstat (limited to 'Eigen/src/Core/util/Macros.h')
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index e7d7d3968..2f39b48fd 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -74,6 +74,30 @@ using Eigen::MatrixBase; #define EIGEN_ONLY_USED_FOR_DEBUG(x) #endif +#ifdef EIGEN_USE_OPENMP +# ifdef __INTEL_COMPILER +# define EIGEN_PRAGMA_OMP_PARALLEL _Pragma("omp parallel default(none) shared(other)") +# else +# define EIGEN_PRAGMA_OMP_PARALLEL _Pragma("omp parallel default(none)") +# endif +# define EIGEN_RUN_PARALLELIZABLE_LOOP(condition) \ + if(condition) \ + { \ + EIGEN_PRAGMA_OMP_PARALLEL \ + { \ + _Pragma("omp for") \ + EIGEN_THE_PARALLELIZABLE_LOOP \ + } \ + } \ + else \ + { \ + EIGEN_THE_PARALLELIZABLE_LOOP \ + } +#else // EIGEN_USE_OPENMP +# define EIGEN_RUN_PARALLELIZABLE_LOOP(condition) EIGEN_THE_PARALLELIZABLE_LOOP +#endif + + // FIXME with the always_inline attribute, // gcc 3.4.x reports the following compilation error: // Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const' |