(to the moderator: how can I/or could you please change the thread title to “floating point model pragma’s”?)
Does nvcc have #pragra’s that control the floating point model,
#pragma floatcontrol or similar.
We use if( AX+BY+C > 0 ) construct in a couple of places
in our CUDA code (sm 2.0, Tesla 2070) and need to make sure
it produces IDENTICAL outcomes for given A,B,C,X,Y,
and that would be immune to compiler’s reordering the floating
point operations trying to optimize the code.
The idea is to be able to use something along the lines of
#pragma floatcontrol(precise, on, push)
to ensure that compiler will not interpret the criteria
as, roughly speaking, (AX+BY)+C in one place in the code
and AX+(BY+C) in another. (We would obviously want to
keep the most aggressive optimization for the rest of the code.)
Here are a couple of links that discuss floating point model pragma’s
http://stackoverflow.com/questions/3407493/floating-point-c-compiler-options-preventing-a-b-a-1-b