Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/eigen3/Eigen/src/Core/util/MKL_support.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  Copyright (c) 2011, Intel Corporation. All rights reserved.
0003 
0004  Redistribution and use in source and binary forms, with or without modification,
0005  are permitted provided that the following conditions are met:
0006 
0007  * Redistributions of source code must retain the above copyright notice, this
0008    list of conditions and the following disclaimer.
0009  * Redistributions in binary form must reproduce the above copyright notice,
0010    this list of conditions and the following disclaimer in the documentation
0011    and/or other materials provided with the distribution.
0012  * Neither the name of Intel Corporation nor the names of its contributors may
0013    be used to endorse or promote products derived from this software without
0014    specific prior written permission.
0015 
0016  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
0017  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0018  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0019  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
0020  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
0021  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0022  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
0023  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0024  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0025  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0026 
0027  ********************************************************************************
0028  *   Content : Eigen bindings to Intel(R) MKL
0029  *   Include file with common MKL declarations
0030  ********************************************************************************
0031 */
0032 
0033 #ifndef EIGEN_MKL_SUPPORT_H
0034 #define EIGEN_MKL_SUPPORT_H
0035 
0036 #ifdef EIGEN_USE_MKL_ALL
0037   #ifndef EIGEN_USE_BLAS
0038     #define EIGEN_USE_BLAS
0039   #endif
0040   #ifndef EIGEN_USE_LAPACKE
0041     #define EIGEN_USE_LAPACKE
0042   #endif
0043   #ifndef EIGEN_USE_MKL_VML
0044     #define EIGEN_USE_MKL_VML
0045   #endif
0046 #endif
0047 
0048 #ifdef EIGEN_USE_LAPACKE_STRICT
0049   #define EIGEN_USE_LAPACKE
0050 #endif
0051 
0052 #if defined(EIGEN_USE_MKL_VML) && !defined(EIGEN_USE_MKL)
0053   #define EIGEN_USE_MKL
0054 #endif
0055 
0056 
0057 #if defined EIGEN_USE_MKL
0058 #   if (!defined MKL_DIRECT_CALL) && (!defined EIGEN_MKL_NO_DIRECT_CALL)
0059 #       define MKL_DIRECT_CALL
0060 #       define MKL_DIRECT_CALL_JUST_SET
0061 #   endif
0062 #   include <mkl.h>
0063 /*Check IMKL version for compatibility: < 10.3 is not usable with Eigen*/
0064 #   ifndef INTEL_MKL_VERSION
0065 #       undef EIGEN_USE_MKL /* INTEL_MKL_VERSION is not even defined on older versions */
0066 #   elif INTEL_MKL_VERSION < 100305    /* the intel-mkl-103-release-notes say this was when the lapacke.h interface was added*/
0067 #       undef EIGEN_USE_MKL
0068 #   endif
0069 #   ifndef EIGEN_USE_MKL
0070     /*If the MKL version is too old, undef everything*/
0071 #       undef   EIGEN_USE_MKL_ALL
0072 #       undef   EIGEN_USE_LAPACKE
0073 #       undef   EIGEN_USE_MKL_VML
0074 #       undef   EIGEN_USE_LAPACKE_STRICT
0075 #       undef   EIGEN_USE_LAPACKE
0076 #       ifdef   MKL_DIRECT_CALL_JUST_SET
0077 #           undef MKL_DIRECT_CALL
0078 #       endif
0079 #   endif
0080 #endif
0081 
0082 #if defined EIGEN_USE_MKL
0083 
0084 #define EIGEN_MKL_VML_THRESHOLD 128
0085 
0086 /* MKL_DOMAIN_BLAS, etc are defined only in 10.3 update 7 */
0087 /* MKL_BLAS, etc are not defined in 11.2 */
0088 #ifdef MKL_DOMAIN_ALL
0089 #define EIGEN_MKL_DOMAIN_ALL MKL_DOMAIN_ALL
0090 #else
0091 #define EIGEN_MKL_DOMAIN_ALL MKL_ALL
0092 #endif
0093 
0094 #ifdef MKL_DOMAIN_BLAS
0095 #define EIGEN_MKL_DOMAIN_BLAS MKL_DOMAIN_BLAS
0096 #else
0097 #define EIGEN_MKL_DOMAIN_BLAS MKL_BLAS
0098 #endif
0099 
0100 #ifdef MKL_DOMAIN_FFT
0101 #define EIGEN_MKL_DOMAIN_FFT MKL_DOMAIN_FFT
0102 #else
0103 #define EIGEN_MKL_DOMAIN_FFT MKL_FFT
0104 #endif
0105 
0106 #ifdef MKL_DOMAIN_VML
0107 #define EIGEN_MKL_DOMAIN_VML MKL_DOMAIN_VML
0108 #else
0109 #define EIGEN_MKL_DOMAIN_VML MKL_VML
0110 #endif
0111 
0112 #ifdef MKL_DOMAIN_PARDISO
0113 #define EIGEN_MKL_DOMAIN_PARDISO MKL_DOMAIN_PARDISO
0114 #else
0115 #define EIGEN_MKL_DOMAIN_PARDISO MKL_PARDISO
0116 #endif
0117 #endif
0118 
0119 #if defined(EIGEN_USE_BLAS) && !defined(EIGEN_USE_MKL)
0120 #include "../../misc/blas.h"
0121 #endif
0122 
0123 namespace Eigen {
0124 
0125 typedef std::complex<double> dcomplex;
0126 typedef std::complex<float>  scomplex;
0127 
0128 #if defined(EIGEN_USE_MKL)
0129 typedef MKL_INT BlasIndex;
0130 #else
0131 typedef int BlasIndex;
0132 #endif
0133 
0134 } // end namespace Eigen
0135 
0136 
0137 #endif // EIGEN_MKL_SUPPORT_H