Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Guillaume_A_
New Contributor I
137 Views

dgemm - Intel inspector: "uninitialized memory acces"

Jump to solution

Hi,

I launched an Memory Error Analysis with Intel Inspector on simple test of the dgemm function and i got this warning: "uninitialized memory access" located on the dgemm call.

Here is my test (really simple !) :

void dgemm_test()
{
  double *A,*B,*C;
  double alpha, beta;
  int m,i;

  m = 10;
  A = (double*)mkl_malloc((m*m)*sizeof(double),128);
  B = (double*)mkl_malloc((m*m)*sizeof(double),128);
  C = (double*)mkl_malloc((m*m)*sizeof(double),128);

  for(i=0; i<m*m; i++){
    A = (double)(rand() % (m*m)) / (double)(m*m);
    B = (double)(rand() % (m*m)) / (double)(m*m);
    C = 0.0;
  }

  alpha = 1.0;
  beta = 0.0;
  cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, m, m, m, alpha, A, m, B, m, beta, C, m);

  mkl_free(A);
  mkl_free(B);
  mkl_free(C);
}

Each buffer seems to be initialized... Do I have to be worried about this warning ? Is it an expected behavior ?

My configuration: Intel Inspector XE 2013.  MKL: 11.1.2 (32bit mode). CPU: Xeon E5-1620. OS: W7 64bit (SP1).

Thanks in advance for your help !

0 Kudos
1 Solution
Zhang_Z_Intel
Employee
137 Views

This is a known problem of Intel Inspector. It reports false alarms for some MKL routines.

View solution in original post

3 Replies
mecej4
Black Belt
137 Views

The problem with partial reports such as yours is that they cannot be verified.

Using the current versions of Intel C (15.0) and MKL (11.2) with the older Inspector 2013, I added a few lines of code to make a complete example as shown below. Note that I have suppressed initialization of C, which should be OK when alpha = 0. I see no reports of uninitialized variables with Inspector XE. However, when I change the value of alpha to a nonzero value, I do get detection of uninitialized variables. Reactivation of the initialization of C made the error go away. All these findings agree with what one expects.

#include <stdio.h>
#include <mkl.h>

void dgemm_test()
{
  double *A,*B,*C;
  double alpha, beta;
  int m,i;

  m = 10;
  A = (double*)mkl_malloc((m*m)*sizeof(double),128);
  B = (double*)mkl_malloc((m*m)*sizeof(double),128);
  C = (double*)mkl_malloc((m*m)*sizeof(double),128);

  for(i=0; i<m*m; i++){
    A = (double)(rand() % (m*m)) / (double)(m*m);
    B = (double)(rand() % (m*m)) / (double)(m*m);
//    C = 0.0;
  } 

  alpha = 0.0;
  beta  = 1.0;
  cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, m, m, m, alpha, A, m, B, m, beta, C, m);

  mkl_free(A);
  mkl_free(B);
  mkl_free(C);
}

main(){
dgemm_test();
}

 

Zhang_Z_Intel
Employee
138 Views

This is a known problem of Intel Inspector. It reports false alarms for some MKL routines.

View solution in original post

Gennady_F_Intel
Moderator
137 Views

btw, the latest version of Inspector ( Intel(R) Inspector XE 2015) doesn't report such sort of problem. 

Reply