This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1015

Summary: EIGEN_USE_MKL_ALL cause compilation failures due to template parameter errors
Product: Eigen Reporter: Yan Zhou <zhouyan>
Component: InteroperabilityAssignee: Nobody <eigen.nobody>
Status: RESOLVED DUPLICATE    
Severity: Compilation Problem CC: chtz, gael.guennebaud, hauke.heibel, jacob.benoit.1
Priority: Normal    
Version: 3.3 (current stable)   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 558    

Description Yan Zhou 2015-05-07 20:19:37 UTC
When using the most recent development version of Eigen as the time of writing,
the macro EIGEN_USE_MKL_ALL causes quite a few errors. All appears to be the case that a non-type argument is used when a type parameter is expected in template

Below is a minimal example
#define EIGEN_USE_MKL_ALL
#include <Eigen/Eigen>

int main () {}


And the following is output from clang, (other compilers produce the same errors, just lest readable)

$ clang++ -o test test.cpp 
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:51:49: error: template argument for template type parameter must be a type
  general_matrix_vector_product<Index,LhsScalar,LhsStorageOrder,ConjugateLhs,RhsScalar,ConjugateRhs,BuiltIn> {};
                                                ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:84:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(double)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:55:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:84:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(double)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:72:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,RowMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:85:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(float)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:55:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:85:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(float)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:72:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,RowMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:86:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(dcomplex)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:55:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:86:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(dcomplex)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:72:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,RowMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:87:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(scomplex)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:55:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,ColMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:416:
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:87:1: error: template argument for template type parameter must be a type
EIGEN_MKL_GEMV_SPECIALIZE(scomplex)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h:72:51: note: expanded from macro 'EIGEN_MKL_GEMV_SPECIALIZE'
struct general_matrix_vector_product<Index,Scalar,RowMajor,ConjugateLhs,Scalar,ConjugateRhs,Specialized> { \
                                                  ^~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/util/BlasUtil.h:38:39: note: template parameter is declared here
         typename LhsScalar, typename LhsMapper, int LhsStorageOrder, bool ConjugateLhs,
                                      ^
In file included from test.cpp:2:
In file included from /usr/local/include/eigen3/Eigen/Eigen:1:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:426:
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:79:5: error: unknown template name 'assign_impl'
  : assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>,Traversal,Unrolling,BuiltIn>
    ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: error: explicit specialization of non-template struct 'assign_impl'
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:10: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
         ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:124:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,CompleteUnrolling)
                                ^~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:125:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,InnerUnrolling)
                                ^~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:126:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearTraversal,NoUnrolling)
                                ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:127:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearTraversal,CompleteUnrolling)
                                ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:128:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(InnerVectorizedTraversal,NoUnrolling)
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:129:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(InnerVectorizedTraversal,CompleteUnrolling)
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:130:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(InnerVectorizedTraversal,InnerUnrolling)
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:131:33: error: template argument for template type parameter must be a type
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearVectorizedTraversal,CompleteUnrolling)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:117:72: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  struct assign_impl<Derived1, Eigen::CwiseUnaryOp<UnaryOp, Derived2>, TRAVERSAL, UNROLLING, Specialized>  {  \
                                                                       ^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:123:1: note: template parameter is declared here
EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling)
^
/usr/local/include/eigen3/Eigen/src/Core/Assign_MKL.h:116:59: note: expanded from macro 'EIGEN_MKL_VML_SPECIALIZE_ASSIGN'
  template<typename Derived1, typename Derived2, typename UnaryOp> \
                                                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
$
Comment 1 Christoph Hertzberg 2015-05-08 14:10:41 UTC
I'm afraid MKL support hasn't been tested for a long time.
There have been several refactorings in the product kernels, which where not (at least not all) ported to MKL yet, e.g:
https://bitbucket.org/eigen/eigen/commits/9cc5a931b2c665a9d851
Comment 2 Gael Guennebaud 2015-06-23 09:08:07 UTC

*** This bug has been marked as a duplicate of bug 923 ***
Comment 3 Nobody 2019-12-04 14:38:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1015.