- split and rename defined tokens to enable the use of BLAS/Lapack/VML/etc

- include MKL headers outside the Eigen namespace.
This commit is contained in:
Gael Guennebaud
2011-12-09 10:06:49 +01:00
parent 015c331252
commit 43cdd242d0
17 changed files with 53 additions and 37 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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 {
/**********************************************************************

View File

@@ -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 {
/**********************************************************************

View File

@@ -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

View File

@@ -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 {

View File

@@ -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 {
/**********************************************************************

View File

@@ -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 {

View File

@@ -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 {
/**********************************************************************

View File

@@ -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

View File

@@ -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
#endif
#elif defined EIGEN_USE_BLAS
#include "../../misc/blas.h"
#endif
#endif