Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Lars_K_1
Beginner
73 Views

Bug in 64-bit mkl_dcsrmv

Hello,

I need sparse matrix-vector multiplication in my code and want to use the MKL, as I want to also use the Xeon Phi cards in my system. However, the 64-bit version (the one activated by the -DMKL_ILP64 flag for the Intel compiler) seems to be broken

#include <iostream>
#include <mkl.h>

int main() {
  MKL_INT           rows = 2;
  MKL_INT           cols = 2;
  double const     alpha = 1.0;
  double const     val[] = {1.0, 1.0, 1.0};
  MKL_INT         indx[] = {0, 1, 1};
  MKL_INT        outer[] = {0, 2, 3};
  MKL_INT const*   pntrb = outer;
  MKL_INT const*   pntre = outer + 1;
  double const       x[] = {0.0, 1.0};
  double const      beta = 0.0;
  double             y[] = {0.0, 0.0};

  mkl_dcsrmv("N", &rows, &cols, &alpha, "G**C", val, indx, pntrb, pntre, x, &beta, y);
  std::cout << "y = {" << y[0] << ", " << y[1] << "}" << std::endl;
}

When I compile the above code with: icpc -mkl, I get the output: "y = {1, 1}", which should be expected. When I do so with the -DMKL_ILP64 switch I get: "y = {0, 0}".

I need this fixed rather quickly, as our client really needs his Xeon Phi cards running this code. Can you please confirm this bug? I am using Intel Compiler version 16.0.3 20160415 as well as Intel MKL 11.3 Update 3.

Best regards,

Lars

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
73 Views

Lars, when you use compiler option -mkl or /Qmkl, then LP64 for the Intel® 64 architecture will be used. 

Please have a look at the MKL's User's Guide - Using the /Qmkl Compiler Option

Lars_K_1
Beginner
73 Views

Thanks for your help, I didn't know that this was the default when using the -mkl flag. I thought that by defining -DMKL_ILP64 the compiler would choose the correct linking when also defining the mkl flag. I think this should be coordinated within the Intel compiler. But anyway: this is no bug within the MKL. It works now using the Link Line Advisor.

Reply