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?
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.
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?