Community
cancel
Showing results for 
Search instead for 
Did you mean: 
XUE__Xingyuan
Beginner
82 Views

MKL function cblas_sgemv gives different results each time

Hi, I have used cblas_sgemv but this function gives different results each time and I have checked the inputs which are always the same. Sometimes the result is correct (with 1e-6 L2 norm error compared to the correct result). Could someone tell me why I have this?

 

Thanks,

Cindy

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
82 Views

What do you mean by the different results? Do you expect to see bit to bit outputs? if yes, then you may try to use the CNR feature which will allow you to get the same output from run to run.

XUE__Xingyuan
Beginner
82 Views

I have solved the problem. By running the following two commands, the results are correct. 

export MKL_INTERFACE_LAYER=GNU
export MKL_THREADING_LAYER=GNU

More details can be found here.

It seems a linking problem. I just could not figure out why this works. Can anyone explain it to me?

Gennady_F_Intel
Moderator
82 Views

all info you may find out into mkl user's guide.

XUE__Xingyuan
Beginner
82 Views

Thanks for your help.