Monday, 12 August 2013

Dynamic -ffast-math

Dynamic -ffast-math

Is it possible to selectively turn -ffast-math on/off during runtime? For
example, creating classes FastMath and AccurateMath with the common base
class Math, so that one would be able to use both implementations during
runtime? Ditto for flashing subnormals to zero, etc.
In particular, I don't know whether compiling with -ffast-math would emit
an instruction that would, once executed, affect all numerical
computations in the thread (for example, setting a flag to flush
subnormals to zero).

No comments:

Post a Comment