Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

Bug in 64-bit mkl_dcsrmv

$
0
0

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


Viewing all articles
Browse latest Browse all 2652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>