logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

FP_CONTRACT,_FP_FAST_FMAF,_FP_FAST_FMA_HALF - Control expression contraction; fast fma()

Authors

TheKhronosGroup

Fp_Contract

       The FP_CONTRACT pragma takes the form:

       #pragma OPENCL FP_CONTRACT on-off-switch

       FP_CONTRACT can be used to allow (if the state is on) or disallow (if the state is off) the
       implementation to contract expressions. Each pragma can occur either outside external declarations or
       preceding all explicit declarations and statements inside a compound statement.

       The parameter on-off-switch is one of ON, OFF or DEFAULT. The DEFAULT value is ON.

       When outside external declarations, the pragma takes effect from its occurrence until another FP_CONTRACT
       pragma is encountered, or until the end of the translation unit. When inside a compound statement, the
       pragma takes effect from its occurrence until another FP_CONTRACT pragma is encountered (including within
       a nested compound statement), or until the end of the compound statement; at the end of a compound
       statement the state for the pragma is restored to its condition just before the compound statement. If
       this pragma is used in any other context, the behavior is undefined.

Fp_Fast_Fmaf And Fp_Fast_Fma

       The FP_FAST_FMAF macro indicates whether the fma(3clc) function is fast compared with direct code for
       single precision floating-point. If defined, the FP_FAST_FMAF macro shall indicate that the fma(3clc)()
       function generally executes about as fast as, or faster than, a multiply and an add of float operands.

       The FP_FAST_FMA macro indicates whether the fma(3clc) family of functions are fast compared with direct
       code for double precision floating-point. If defined, the FP_FAST_FMA macro shall indicate that the
       fma(3clc)() function generally executes about as fast as, or faster than, a multiply and an add of double
       operands.

       The FP_FAST_FMA_HALF macro indicates whether the fma(3clc)() family of functions are fast compared with
       direct code for half precision floating-point. If defined, the FP_FAST_FMA_HALF macro shall indicate that
       the fma(3clc)() function generally executes about as fast as, or faster than, a multiply and an add of
       half operands

Name

       FP_CONTRACT,_FP_FAST_FMAF,_FP_FAST_FMA_HALF - Control expression contraction; fast fma()

Notes

        1. OpenCL Specification
           page 252, section 6.12.2.1 - Floating-point macros and pragmas

The Khronos Group                                  11/18/2024                         FP_CONTRACT,FP_FAST(3clc)

See Also

mathFunctions(3clc), mathConstants(3clc), macroLimits(3clc)

Specification

OpenCLSpecification[1]

See Also