Skip to content

Differences between CPU and GPU compilation regarding rounding floats #228

Answered by Firestar99
149segolte asked this question in Q&A
Discussion options

You must be logged in to vote

In general, floating point between two different machines must not always be the same. Nowadays we generally do no-fast-math on the CPU and have the compiler emit exactly the floating point operations we write, at the expense of fewer optimizations but better accuracy across compilers and machines. But even that excludes complex fp operations such as sin or cos, which must only be accurate to some degree.
On the GPU it's an entirely different story again. The default is fast-math, optimization of fp as much as possible, merge multiply adds into FMAs and even the hardware itself may respect the rounding mode or may just not do any rounding at all, also denormals are not supported, all in t…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@149segolte
Comment options

Comment options

You must be logged in to vote
2 replies
@149segolte
Comment options

@LegNeato
Comment options

Comment options

You must be logged in to vote
5 replies
@Firestar99
Comment options

Answer selected by 149segolte
@149segolte
Comment options

@LegNeato
Comment options

@Firestar99
Comment options

@schell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants