3

What does the OpenCL compiler option -cl-fast-relaxed-math do?

From reading the documentation - it looks like -cl-fast-relaxed-math allows a kernel to do floating point math on any variables - even if those variables point to the wrong data type, cause division by zero, or some other illegal behavior.

Is this correct? In what situation would this compiler option be useful?

einpoklum
  • 118,144
  • 57
  • 340
  • 684
benshope
  • 2,936
  • 4
  • 27
  • 39
  • 3
    Enables -cl-finite-math-only and -cl-unsafe-math-optimizations. These two options provide aditional speed by removing some checks to the input values. IE: Not check for NaN numbers. However, if the input values happend to BE non normal numbers, the results are unknown. – DarkZeros Aug 18 '13 at 22:59
  • DarkZeros is correct (and should put this as an answer). This optimization flag enables faster math operations, it does not change the language rules or parsing. – Dithermaster Aug 23 '13 at 00:47

1 Answers1

2

From comments:

Enables -cl-finite-math-only and -cl-unsafe-math-optimizations. These two options provide aditional speed by removing some checks to the input values. IE: Not check for NaN numbers. However, if the input values happend to BE non normal numbers, the results are unknown. – DarkZeros

user2746401
  • 3,157
  • 2
  • 21
  • 46