JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
com.jogamp.opencl.CLProgram.CompilerOptions Interface Reference

Common compiler options for the OpenCL compiler. More...

Collaboration diagram for com.jogamp.opencl.CLProgram.CompilerOptions:

Static Public Attributes

static final String SINGLE_PRECISION_CONSTANTS = "-cl-single-precision-constant"
 Treat double precision floating-point constant as single precision constant. More...
 
static final String DENORMS_ARE_ZERO = "-cl-denorms-are-zero"
 This option controls how single precision and double precision denormalized numbers are handled. More...
 
static final String DISABLE_OPT = "-cl-opt-disable"
 This option disables all optimizations. More...
 
static final String STRICT_ALIASING = "-cl-strict-aliasing"
 This option allows the compiler to assume the strictest aliasing rules. More...
 
static final String ENABLE_MAD = "-cl-mad-enable"
 Allow a * b + c to be replaced by a mad. More...
 
static final String NO_SIGNED_ZEROS = "-cl-no-signed-zeros"
 Allow optimizations for floating-point arithmetic that ignore the signedness of zero. More...
 
static final String UNSAFE_MATH = "-cl-unsafe-math-optimizations"
 Allow optimizations for floating-point arithmetic that
(a) assume that arguments and results are valid,
(b) may violate IEEE 754 standard and
(c) may violate the OpenCL numerical compliance requirements as defined in section 7.4 for single-precision floating-point, section 9.3.9 for double-precision floating-point, and edge case behavior in section 7.5. More...
 
static final String FINITE_MATH_ONLY = "-cl-finite-math-only"
 Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or plus/minus infinity. More...
 
static final String FAST_RELAXED_MATH = "-cl-fast-relaxed-math"
 Sets the optimization options -cl-finite-math-only (FINITE_MATH_ONLY) and -cl-unsafe-math-optimizations (UNSAFE_MATH). More...
 
static final String DISABLE_WARNINGS = "-w"
 Inhibit all warning messages. More...
 
static final String WARNINGS_ARE_ERRORS = "-Werror"
 Make all warnings into errors. More...
 

Detailed Description

Common compiler options for the OpenCL compiler.

Definition at line 767 of file CLProgram.java.

Member Data Documentation

◆ DENORMS_ARE_ZERO

final String com.jogamp.opencl.CLProgram.CompilerOptions.DENORMS_ARE_ZERO = "-cl-denorms-are-zero"
static

This option controls how single precision and double precision denormalized numbers are handled.

If specified as a build option, the single precision denormalized numbers may be flushed to zero and if the optional extension for double precision is supported, double precision denormalized numbers may also be flushed to zero. This is intended to be a performance hint and the OpenCL compiler can choose not to flush denorms to zero if the device supports single precision (or double precision) denormalized numbers.
This option is ignored for single precision numbers if the device does not support single precision denormalized numbers i.e. CLDevice.FPConfig#DENORM is not present in the set returned by CLDevice#getSingleFPConfig()
This option is ignored for double precision numbers if the device does not support double precision or if it does support double precision but CLDevice.FPConfig#DENORM is not present in the set returned by CLDevice#getDoubleFPConfig().
This flag only applies for scalar and vector single precision floating-point variables and computations on these floating-point variables inside a program. It does not apply to reading from or writing to image objects.

Definition at line 787 of file CLProgram.java.

◆ DISABLE_OPT

final String com.jogamp.opencl.CLProgram.CompilerOptions.DISABLE_OPT = "-cl-opt-disable"
static

This option disables all optimizations.

The default is optimizations are enabled.

Definition at line 792 of file CLProgram.java.

◆ DISABLE_WARNINGS

final String com.jogamp.opencl.CLProgram.CompilerOptions.DISABLE_WARNINGS = "-w"
static

Inhibit all warning messages.

Definition at line 845 of file CLProgram.java.

◆ ENABLE_MAD

final String com.jogamp.opencl.CLProgram.CompilerOptions.ENABLE_MAD = "-cl-mad-enable"
static

Allow a * b + c to be replaced by a mad.

The mad computes a * b + c with reduced accuracy. For example, some OpenCL devices implement mad as truncate the result of a * b before adding it to c.

Definition at line 803 of file CLProgram.java.

◆ FAST_RELAXED_MATH

final String com.jogamp.opencl.CLProgram.CompilerOptions.FAST_RELAXED_MATH = "-cl-fast-relaxed-math"
static

Sets the optimization options -cl-finite-math-only (FINITE_MATH_ONLY) and -cl-unsafe-math-optimizations (UNSAFE_MATH).

This allows optimizations for floating-point arithmetic that may violate the IEEE 754 standard and the OpenCL numerical compliance requirements defined in the specification in section 7.4 for single-precision floating-point, section 9.3.9 for double-precision floating-point, and edge case behavior in section 7.5. This option causes the preprocessor macro FAST_RELAXED_MATH to be defined in the OpenCL program.

Definition at line 840 of file CLProgram.java.

◆ FINITE_MATH_ONLY

final String com.jogamp.opencl.CLProgram.CompilerOptions.FINITE_MATH_ONLY = "-cl-finite-math-only"
static

Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or plus/minus infinity.

This option may violate the OpenCL numerical compliance requirements defined in in section 7.4 for single-precision floating-point, section 9.3.9 for double-precision floating-point, and edge case behavior in section 7.5.

Definition at line 830 of file CLProgram.java.

◆ NO_SIGNED_ZEROS

final String com.jogamp.opencl.CLProgram.CompilerOptions.NO_SIGNED_ZEROS = "-cl-no-signed-zeros"
static

Allow optimizations for floating-point arithmetic that ignore the signedness of zero.

IEEE 754 arithmetic specifies the behavior of distinct +0.0 and -0.0 values, which then prohibits simplification of expressions such as x+0.0 or 0.0*x (even with -cl-finite-math-only (FINITE_MATH_ONLY)). This option implies that the sign of a zero result isn't significant.

Definition at line 811 of file CLProgram.java.

◆ SINGLE_PRECISION_CONSTANTS

final String com.jogamp.opencl.CLProgram.CompilerOptions.SINGLE_PRECISION_CONSTANTS = "-cl-single-precision-constant"
static

Treat double precision floating-point constant as single precision constant.

Definition at line 772 of file CLProgram.java.

◆ STRICT_ALIASING

final String com.jogamp.opencl.CLProgram.CompilerOptions.STRICT_ALIASING = "-cl-strict-aliasing"
static

This option allows the compiler to assume the strictest aliasing rules.

Definition at line 797 of file CLProgram.java.

◆ UNSAFE_MATH

final String com.jogamp.opencl.CLProgram.CompilerOptions.UNSAFE_MATH = "-cl-unsafe-math-optimizations"
static

Allow optimizations for floating-point arithmetic that
(a) assume that arguments and results are valid,
(b) may violate IEEE 754 standard and
(c) may violate the OpenCL numerical compliance requirements as defined in section 7.4 for single-precision floating-point, section 9.3.9 for double-precision floating-point, and edge case behavior in section 7.5.

This option includes the -cl-no-signed-zeros (NO_SIGNED_ZEROS) and -cl-mad-enable (ENABLE_MAD) options.

Definition at line 823 of file CLProgram.java.

◆ WARNINGS_ARE_ERRORS

final String com.jogamp.opencl.CLProgram.CompilerOptions.WARNINGS_ARE_ERRORS = "-Werror"
static

Make all warnings into errors.

Definition at line 850 of file CLProgram.java.


The documentation for this interface was generated from the following file: