aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-12-09 10:06:49 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-12-09 10:06:49 +0100
commit43cdd242d0e34aa05e368b3d894c1041aa2cd771 (patch)
treeb9f068f145a293fe0833208aa8185a6f632ac7a0 /Eigen/src
parent015c331252a3b99c187b5607572f1cec531a4d1e (diff)
- split and rename defined tokens to enable the use of BLAS/Lapack/VML/etc
- include MKL headers outside the Eigen namespace.
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/Assign_MKL.h2
-rw-r--r--Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h2
-rw-r--r--Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h2
-rw-r--r--Eigen/src/Core/products/GeneralMatrixVector_MKL.h2
-rw-r--r--Eigen/src/Core/products/Parallelizer.h4
-rw-r--r--Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h2
-rw-r--r--Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h2
-rw-r--r--Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h2
-rw-r--r--Eigen/src/Core/products/TriangularMatrixVector_MKL.h2
-rw-r--r--Eigen/src/Core/products/TriangularSolverMatrix_MKL.h2
-rw-r--r--Eigen/src/Core/util/MKL_support.h30
11 files changed, 31 insertions, 21 deletions
diff --git a/Eigen/src/Core/Assign_MKL.h b/Eigen/src/Core/Assign_MKL.h
index 141015f1b..39315c23c 100644
--- a/Eigen/src/Core/Assign_MKL.h
+++ b/Eigen/src/Core/Assign_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_ASSIGN_VML_H
#define EIGEN_ASSIGN_VML_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
template<typename Op> struct vml_call
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h b/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h
index d86bc0542..5c52f2a07 100644
--- a/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h
+++ b/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_MKL_H
#define EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
template <typename Index, typename Scalar, int AStorageOrder, bool ConjugateA, int ResStorageOrder, int UpLo>
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h b/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h
index 9ad589e66..fad7fff53 100644
--- a/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h
+++ b/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_GENERAL_MATRIX_MATRIX_MKL_H
#define EIGEN_GENERAL_MATRIX_MATRIX_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
/**********************************************************************
diff --git a/Eigen/src/Core/products/GeneralMatrixVector_MKL.h b/Eigen/src/Core/products/GeneralMatrixVector_MKL.h
index 20194c9fa..89130142d 100644
--- a/Eigen/src/Core/products/GeneralMatrixVector_MKL.h
+++ b/Eigen/src/Core/products/GeneralMatrixVector_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_GENERAL_MATRIX_VECTOR_MKL_H
#define EIGEN_GENERAL_MATRIX_VECTOR_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
/**********************************************************************
diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h
index d002f6d2e..889d76c98 100644
--- a/Eigen/src/Core/products/Parallelizer.h
+++ b/Eigen/src/Core/products/Parallelizer.h
@@ -85,7 +85,9 @@ template<typename Index> struct GemmParallelInfo
template<bool Condition, typename Functor, typename Index>
void parallelize_gemm(const Functor& func, Index rows, Index cols, bool transpose)
{
-#if !(defined (EIGEN_HAS_OPENMP)) || defined (EIGEN_MKL)
+ // TODO when EIGEN_USE_BLAS is defined,
+ // we should still enable OMP for other scalar types
+#if !(defined (EIGEN_HAS_OPENMP)) || defined (EIGEN_USE_BLAS)
// FIXME the transpose variable is only needed to properly split
// the matrix product when multithreading is enabled. This is a temporary
// fix to support row-major destination matrices. This whole
diff --git a/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h b/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h
index 338a57a55..2b4e5a4d6 100644
--- a/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h
+++ b/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_MKL_H
#define EIGEN_SELFADJOINT_MATRIX_MATRIX_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
diff --git a/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h b/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h
index 37d20d581..d5a92d9e9 100644
--- a/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h
+++ b/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H
#define EIGEN_SELFADJOINT_MATRIX_VECTOR_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
/**********************************************************************
diff --git a/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h b/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h
index 5c0a07739..6ad62b66c 100644
--- a/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h
+++ b/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_TRIANGULAR_MATRIX_MATRIX_MKL_H
#define EIGEN_TRIANGULAR_MATRIX_MATRIX_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector_MKL.h b/Eigen/src/Core/products/TriangularMatrixVector_MKL.h
index 6acd43c88..a3750ec96 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector_MKL.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_TRIANGULAR_MATRIX_VECTOR_MKL_H
#define EIGEN_TRIANGULAR_MATRIX_VECTOR_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
/**********************************************************************
diff --git a/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h b/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h
index 644ef35c5..3ba20cdda 100644
--- a/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h
+++ b/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h
@@ -33,8 +33,6 @@
#ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_MKL_H
#define EIGEN_TRIANGULAR_SOLVER_MATRIX_MKL_H
-#include "Eigen/src/Core/util/MKL_support.h"
-
namespace internal {
// implements LeftSide op(triangular)^-1 * general
diff --git a/Eigen/src/Core/util/MKL_support.h b/Eigen/src/Core/util/MKL_support.h
index 6d78e97b1..56a03fa32 100644
--- a/Eigen/src/Core/util/MKL_support.h
+++ b/Eigen/src/Core/util/MKL_support.h
@@ -33,12 +33,31 @@
#ifndef EIGEN_MKL_SUPPORT_H
#define EIGEN_MKL_SUPPORT_H
+#ifdef EIGEN_USE_MKL_ALL
+ #ifndef EIGEN_USE_BLAS
+ #define EIGEN_USE_BLAS
+ #endif
+ #ifndef EIGEN_USE_MKL_CLAPACK
+ #define EIGEN_USE_MKL_CLAPACK
+ #endif
+ #ifndef EIGEN_USE_MKL_VML
+ #define EIGEN_USE_MKL_VML
+ #endif
+#endif
+
+#if defined(EIGEN_USE_MKL_CLAPACK) || defined(EIGEN_USE_MKL_VML)
+ #define EIGEN_USE_MKL
+#endif
+
+#if defined EIGEN_USE_MKL
+
#include <mkl.h>
#include <mkl_lapacke.h>
-#include <iostream>
#define EIGEN_MKL_VML_THRESHOLD 128
+namespace Eigen {
+
typedef std::complex<double> dcomplex;
typedef std::complex<float> scomplex;
@@ -80,5 +99,12 @@ inline void assign_conj_scalar_eig2mkl<MKL_Complex8,scomplex>(MKL_Complex8& mklS
} // end namespace internal
+} // end namespace Eigen
+
+#elif defined EIGEN_USE_BLAS
+
+#include "../../misc/blas.h"
+
+#endif
-#endif \ No newline at end of file
+#endif