My program output is in double and floating point values when i compile without -xAVX or -xHOST options results are correct but most of the loops aren't getting vectorized but when i use -xAVX or -xHOST option most of loops are getting vectorized and even the performance has been improved but the precision is lost. When I execute same program for a larger dataset this small precision loss is resulting in wrong output. I've even tried -fp-model precise/strict options along with -xHOST but still i'm getting wrong output.
Is it because of AVX vectorization or something else?
I'm not at the liberty of posting the results.So i can only tell you that out of 6 decimal points, difference is shown in last 2 or 3 decimal points. For a larger datasets the difference also gets increased.
There are certainly lots of places where things can go wrong.
Do you see a difference in accuracy between these options?
The third one should be the case that is giving the poor results. The other three cases may help pin down whether the problem is due to vector width, arithmetic reordering, or something else...
You might need to augment these with changes to the optimization level (e.g., explicitly using "-O1", "-O2", and "-O3") and adding the "-fp-model strict" option to any versions that give trouble.