CLDevices.
A CLProgram must be build using one of the build methods before creating CLKernels.
CLContext#createProgram(java.io.InputStream) , CLContext#createProgram(java.lang.String) , CLContext#createProgram(java.util.Map)
| Modifier and Type | Class and Description |
|---|---|
| public static interface | CLProgram.
Common compiler options for the OpenCL compiler. |
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final CLProgramBinding | |
| private static final ReentrantLock | |
| private Map | |
| private boolean | |
| private final Set | |
| private boolean | noSource
Set if program created from binary, or else getting source can crash the driver on Macs. |
| private boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public CLProgram | |
| public CLProgram | Returns: thisA listener who is notified when the program was built. listener)Builds this program for all devices associated with the context. |
| public CLProgram | |
| public CLProgram | Returns: thisA listener who is notified when the program was built. listener, final CLDevice... A list of devices this program should be build on or null for all devices of its context. devices)Builds this program for the given devices. |
| public CLProgram | |
| public CLProgram | Returns: thisA listener who is notified when the program was built. listener, final String options)Builds this program for all devices associated with the context using the specified build options. |
| public CLProgram | |
| public CLProgram | build(final CLBuildListener
A listener who is notified when the program was built. listener, final String... options)Builds this program for all devices associated with the context using the specified build options. |
| public CLProgram | |
| public CLProgram | Returns: thisA listener who is notified when the program was built. listener, String options, final CLDevice... A list of devices this program should be build on or null for all devices of its context. devices)Builds this program for the given devices and with the specified build options. |
| pack-priv static CLProgram | |
| pack-priv static CLProgram | |
| public CLKernel | |
| public Map | createCLKernels()
Creates all kernels of this program and stores them a Map with the kernel name as key. |
| public static String | |
| public static String | |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| public Map | getBinaries()
Returns the binaries for this program in an ordered Map containing the device as key and the program binaries as value. |
| private int | |
| private String | |
| public String | |
| public String | |
| public Map | |
| public CLProgram. | getBuildStatus(final CLDevice device)
Returns the build status enum for this program on the specified device. |
| public CLDevice[] | |
| private CLKernelBinding | |
| private String | |
| public String | |
| public int | |
| private void | |
| public boolean | isExecutable()
Returns true if the build status 'BUILD_SUCCESS' for at least one device of this program exists. |
| pack-priv void | |
| public static String | |
| public CLProgramConfiguration | |
| public void | release()
Overrides com. Implements com. |
| private void | |
| public void | setNoSource()
Must set this if the program is created from binary so we know not to call getSource(), which can SIGSEGV on Macs if there is no source. |
| public String | toString()
Overrides com. |
| binding | back to summary |
|---|---|
| private final CLProgramBinding binding | |
| buildLock | back to summary |
|---|---|
| private static final ReentrantLock buildLock | |
| buildStatusMap | back to summary |
|---|---|
| private Map<CLDevice, CLProgram. | |
| executable | back to summary |
|---|---|
| private boolean executable | |
| kernels | back to summary |
|---|---|
| private final Set<CLKernel> kernels | |
| noSource | back to summary |
|---|---|
| private boolean noSource Set if program created from binary, or else getting source can crash the driver on Macs. | |
| released | back to summary |
|---|---|
| private boolean released | |
| CLProgram | back to summary |
|---|---|
| private CLProgram(final CLContext context, final long id) | |
| build | back to summary |
|---|---|
| public CLProgram build() Builds this program for all devices associated with the context.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final CLBuildListener listener) Builds this program for all devices associated with the context.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final CLDevice... devices) Builds this program for the given devices. | |
| build | back to summary |
|---|---|
| public CLProgram build(final CLBuildListener listener, final CLDevice... devices) Builds this program for the given devices.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final String options) Builds this program for all devices associated with the context using the specified build options.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final CLBuildListener listener, final String options) Builds this program for all devices associated with the context using the specified build options.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final String... options) Builds this program for all devices associated with the context using the specified build options.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final CLBuildListener listener, final String... options) Builds this program for all devices associated with the context using the specified build options.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final String options, final CLDevice... devices) Builds this program for the given devices and with the specified build options. In case this program was already built and there are kernels associated with this program they will be released first before rebuild.
| |
| build | back to summary |
|---|---|
| public CLProgram build(final CLBuildListener listener, String options, final CLDevice... devices) Builds this program for the given devices and with the specified build options. In case this program was already built and there are kernels associated with this program they will be released first before rebuild.
| |
| create | back to summary |
|---|---|
| pack-priv static CLProgram create(final CLContext context, final String src) | |
| create | back to summary |
|---|---|
| pack-priv static CLProgram create(final CLContext context, final Map<CLDevice, byte[]> binaries) | |
| createCLKernel | back to summary |
|---|---|
| public CLKernel createCLKernel(final String kernelName) Creates a kernel with the specified kernel name. | |
| createCLKernels | back to summary |
|---|---|
| public Map Creates all kernels of this program and stores them a Map with the kernel name as key. | |
| define | back to summary |
|---|---|
| public static String define(final String name) Utility method for defining macros as build options (Returns "-D name"). | |
| define | back to summary |
|---|---|
| public static String define(final String name, final Object value) Utility method for defining macros as build options (Returns "-D name=value"). | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getBinaries | back to summary |
|---|---|
| public Map Returns the binaries for this program in an ordered Map containing the device as key and the program binaries as value. | |
| getBuildInfoInt | back to summary |
|---|---|
| private int getBuildInfoInt(final CLDevice device, final int flag) | |
| getBuildInfoString | back to summary |
|---|---|
| private String getBuildInfoString(final CLDevice device, final int flag) | |
| getBuildLog | back to summary |
|---|---|
| public String getBuildLog() Returns the build log of this program on all devices. The contents of the log are implementation dependent. | |
| getBuildLog | back to summary |
|---|---|
| public String getBuildLog(final CLDevice device) Returns the build log for this program on the specified device. The contents of the log are implementation dependent log can be an empty String. | |
| getBuildStatus | back to summary |
|---|---|
| public Map Returns the build status enum of this program for each device as Map. | |
| getBuildStatus | back to summary |
|---|---|
| public CLProgram. Returns the build status enum for this program on the specified device. | |
| getCLDevices | back to summary |
|---|---|
| public CLDevice[] getCLDevices() Returns all devices associated with this program. | |
| getKernelBinding | back to summary |
|---|---|
| private CLKernelBinding getKernelBinding() | |
| getProgramInfoString | back to summary |
|---|---|
| private String getProgramInfoString(final int flag) | |
| getSource | back to summary |
|---|---|
| public String getSource() Returns the source code of this program. Note sources are not cached, each call of this method calls into Open | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initBuildStatus | back to summary |
|---|---|
| private void initBuildStatus() | |
| isExecutable | back to summary |
|---|---|
| public boolean isExecutable() Returns true if the build status 'BUILD_SUCCESS' for at least one device of this program exists. | |
| onKernelReleased | back to summary |
|---|---|
| pack-priv void onKernelReleased(final CLKernel kernel) | |
| optionsOf | back to summary |
|---|---|
| public static String optionsOf(final String... options) Utility method which builds a properly seperated option string. | |
| prepare | back to summary |
|---|---|
| public CLProgramConfiguration prepare() Prepares the build for this program by returning a new | |
| release | back to summary |
|---|---|
| public void release() Overrides com. Implements com. Releases this program with its kernels.
| |
| releaseKernels | back to summary |
|---|---|
| private void releaseKernels() | |
| setNoSource | back to summary |
|---|---|
| public void setNoSource() Must set this if the program is created from binary so we know not to call getSource(), which can SIGSEGV on Macs if there is no source. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DENORMS_ARE_ZERO
This option controls how single precision and double precision denormalized numbers are handled. |
| public static final String | DISABLE_OPT
This option disables all optimizations. |
| public static final String | DISABLE_WARNINGS
Inhibit all warning messages. |
| public static final String | ENABLE_MAD
Allow a * b + c to be replaced by a mad. |
| public static final String | FAST_RELAXED_MATH
Sets the optimization options -cl-finite-math-only ( |
| public static final String | FINITE_MATH_ONLY
Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or plus/minus infinity. |
| public static final String | NO_SIGNED_ZEROS
Allow optimizations for floating-point arithmetic that ignore the signedness of zero. |
| public static final String | SINGLE_PRECISION_CONSTANTS
Treat double precision floating-point constant as single precision constant. |
| public static final String | STRICT_ALIASING
This option allows the compiler to assume the strictest aliasing rules. |
| public static final String | UNSAFE_MATH
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. |
| public static final String | WARNINGS_ARE_ERRORS
Make all warnings into errors. |
| DENORMS_ARE_ZERO | back to summary |
|---|---|
| public static final String DENORMS_ARE_ZERO 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. | |
| DISABLE_OPT | back to summary |
|---|---|
| public static final String DISABLE_OPT This option disables all optimizations. The default is optimizations are enabled. | |
| DISABLE_WARNINGS | back to summary |
|---|---|
| public static final String DISABLE_WARNINGS Inhibit all warning messages. | |
| ENABLE_MAD | back to summary |
|---|---|
| public static final String ENABLE_MAD 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. | |
| FAST_RELAXED_MATH | back to summary |
|---|---|
| public static final String FAST_RELAXED_MATH Sets the optimization options -cl-finite-math-only ( | |
| FINITE_MATH_ONLY | back to summary |
|---|---|
| public static final String FINITE_MATH_ONLY 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. | |
| NO_SIGNED_ZEROS | back to summary |
|---|---|
| public static final String NO_SIGNED_ZEROS 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 ( | |
| SINGLE_PRECISION_CONSTANTS | back to summary |
|---|---|
| public static final String SINGLE_PRECISION_CONSTANTS Treat double precision floating-point constant as single precision constant. | |
| STRICT_ALIASING | back to summary |
|---|---|
| public static final String STRICT_ALIASING This option allows the compiler to assume the strictest aliasing rules. | |
| UNSAFE_MATH | back to summary |
|---|---|
| public static final String UNSAFE_MATH Allow optimizations for floating-point arithmetic that | |
| WARNINGS_ARE_ERRORS | back to summary |
|---|---|
| public static final String WARNINGS_ARE_ERRORS Make all warnings into errors. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final CLProgram. | |
| public static final CLProgram. | |
| public static final CLProgram. | |
| public static final CLProgram. | |
| public final int | STATUS
Value of wrapped OpenCL device type. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CLProgram. | |
| public static CLProgram. | |
| public static CLProgram. |
| BUILD_ERROR | back to summary |
|---|---|
| public static final CLProgram. | |
| BUILD_IN_PROGRESS | back to summary |
|---|---|
| public static final CLProgram. | |
| BUILD_NONE | back to summary |
|---|---|
| public static final CLProgram. | |
| BUILD_SUCCESS | back to summary |
|---|---|
| public static final CLProgram. | |
| STATUS | back to summary |
|---|---|
| public final int STATUS Value of wrapped OpenCL device type. | |
| Status | back to summary |
|---|---|
| private Status(final int status) | |
| valueOf | back to summary |
|---|---|
| public static CLProgram. | |
| valueOf | back to summary |
|---|---|
| public static CLProgram. | |
| values | back to summary |
|---|---|
| public static CLProgram. | |