After using Intel MKL for Eigen, calculate "VectorXd * Matrix" comlains error

19 Views Asked by At
#include <iostream>
#define EIGEN_USE_MKL_ALL

#include <Eigen/Core>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;

void test() {
    MatrixXd x_train(3, 3), y_train(3, 3), w_ = MatrixXd::Random(3, 5);
    x_train << 1, 2, 3, 4, 5, 6, 7, 8, 9;
    y_train << 1, 0, 0, 0, 1, 0, 0, 0, 1;
    VectorXd v = x_train.col(0);
    cout << v.transpose() * w_ << endl;
}

Console logs:

Intel MKL ERROR: Parameter 2 was incorrect on entry to DGEMV .
0 0 0 0 0

My development environment is VS2022. There was no error when I commented out the second line, but I want to use MKL to accelerate the operation. Are there any solutions?

0

There are 0 best solutions below