Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Sharath_K_1
Beginner
70 Views

Precision lost when compiled with -xAVX or -xHOST

Hi all,

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?

Thanks

Sharath kumar

 

 

0 Kudos
3 Replies
Bernard
Black Belt
70 Views

Can you provide more details on precision loss?

Sharath_K_1
Beginner
70 Views

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.

McCalpinJohn
Black Belt
70 Views

There are certainly lots of places where things can go wrong. 

Do you see a difference in accuracy between these options?

  • -xSSE4.1
  • -xSSE4.1 -no-vec
  • -xAVX
  • -xAVX -no-vec

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.

Reply