Do all the OpenCL optimization-related options default to false?

Viewed 90

An OpenCL implementation compiler takes (see specs for 2.2 or 3.0), among others, the following command-line options:

  • -cl-single-precision-constant
  • -cl-denorms-are-zero
  • -cl-fp32-correctly-rounded-divide-sqrt
  • -cl-opt-disable
  • -cl-mad-enable
  • -cl-no-signed-zeros
  • -cl-unsafe-math-optimizations
  • -cl-finite-math-only
  • -cl-fast-relaxed-math
  • -cl-uniform-work-group-size
  • -cl-no-subgroup-ifp

are these all required by the OpenCL spec to be false by default? If not, do they all have a defined default? Or - does each implementer set its own defaults?

1 Answers

Yes, they are all false by default if not explicitly set.

According to the OpenCL specification: "These options are not turned on by default since it can result in incorrect output for programs which depend on an exact implementation of IEEE 754 rules/specifications for math functions."

Related