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

Represents a OpenCL program executed on one or more CLDevices. More...

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

Classes

interface  CompilerOptions
 Common compiler options for the OpenCL compiler. More...
 
enum  Status
 

Public Member Functions

CLProgram build ()
 Builds this program for all devices associated with the context. More...
 
CLProgram build (final CLBuildListener listener)
 Builds this program for all devices associated with the context. More...
 
CLProgram build (final CLDevice... devices)
 Builds this program for the given devices. More...
 
CLProgram build (final CLBuildListener listener, final CLDevice... devices)
 Builds this program for the given devices. More...
 
CLProgram build (final String options)
 Builds this program for all devices associated with the context using the specified build options. More...
 
CLProgram build (final CLBuildListener listener, final String options)
 Builds this program for all devices associated with the context using the specified build options. More...
 
CLProgram build (final String... options)
 Builds this program for all devices associated with the context using the specified build options. More...
 
CLProgram build (final CLBuildListener listener, final String... options)
 Builds this program for all devices associated with the context using the specified build options. More...
 
CLProgram build (final String options, final CLDevice... devices)
 Builds this program for the given devices and with the specified build options. More...
 
CLProgram build (final CLBuildListener listener, String options, final CLDevice... devices)
 Builds this program for the given devices and with the specified build options. More...
 
CLProgramConfiguration prepare ()
 Prepares the build for this program by returning a new CLProgramConfiguration. More...
 
CLKernel createCLKernel (final String kernelName)
 Creates a kernel with the specified kernel name. More...
 
Map< String, CLKernelcreateCLKernels ()
 Creates all kernels of this program and stores them a Map with the kernel name as key. More...
 
void release ()
 Releases this program with its kernels. More...
 
CLDevice[] getCLDevices ()
 Returns all devices associated with this program. More...
 
String getBuildLog ()
 Returns the build log of this program on all devices. More...
 
Map< CLDevice, StatusgetBuildStatus ()
 Returns the build status enum of this program for each device as Map. More...
 
boolean isExecutable ()
 Returns true if the build status 'BUILD_SUCCESS' for at least one device of this program exists. More...
 
String getBuildLog (final CLDevice device)
 Returns the build log for this program on the specified device. More...
 
Status getBuildStatus (final CLDevice device)
 Returns the build status enum for this program on the specified device. More...
 
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. More...
 
String getSource ()
 Returns the source code of this program. More...
 
Map< CLDevice, byte[]> getBinaries ()
 Returns the binaries for this program in an ordered Map containing the device as key and the program binaries as value. More...
 
String toString ()
 
boolean equals (final Object obj)
 
int hashCode ()
 

Static Public Member Functions

static String optionsOf (final String... options)
 Utility method which builds a properly seperated option string. More...
 
static String define (final String name)
 Utility method for defining macros as build options (Returns "-D name"). More...
 
static String define (final String name, final Object value)
 Utility method for defining macros as build options (Returns "-D name=value"). More...
 

Detailed Description

Represents a OpenCL program executed on one or more CLDevices.

A CLProgram must be build using one of the build methods before creating CLKernels.

See also
CLContext::createProgram(java.io.InputStream)
CLContext::createProgram(java.lang.String)
CLContext::createProgram(java.util.Map)
Author
Michael Bien, et al.

Definition at line 64 of file CLProgram.java.

Member Function Documentation

◆ build() [1/10]

CLProgram com.jogamp.opencl.CLProgram.build ( )

Builds this program for all devices associated with the context.

Returns
this

Definition at line 226 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build() [2/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final CLBuildListener  listener)

Builds this program for all devices associated with the context.

See also
CLBuildListener
Parameters
listenerA listener who is notified when the program was built.
Returns
this

Definition at line 237 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [3/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final CLBuildListener  listener,
final CLDevice...  devices 
)

Builds this program for the given devices.

See also
CLBuildListener
Parameters
listenerA listener who is notified when the program was built.
devicesA list of devices this program should be build on or null for all devices of its context.
Returns
this

Definition at line 259 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [4/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final CLBuildListener  listener,
final String  options 
)

Builds this program for all devices associated with the context using the specified build options.

See also
CompilerOptions
CLBuildListener
Parameters
listenerA listener who is notified when the program was built.
Returns
this

Definition at line 281 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [5/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final CLBuildListener  listener,
final String...  options 
)

Builds this program for all devices associated with the context using the specified build options.

See also
CompilerOptions
CLBuildListener
Parameters
listenerA listener who is notified when the program was built.

Definition at line 301 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [6/10]

CLProgram com.jogamp.opencl.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.

See also
CompilerOptions
CLBuildListener
Returns
this
Parameters
devicesA list of devices this program should be build on or null for all devices of its context.
listenerA listener who is notified when the program was built.

Definition at line 327 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [7/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final CLDevice...  devices)

Builds this program for the given devices.

Parameters
devicesA list of devices this program should be build on or null for all devices of its context.
Returns
this

Definition at line 247 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [8/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final String  options)

Builds this program for all devices associated with the context using the specified build options.

See also
CompilerOptions
Returns
this

Definition at line 269 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [9/10]

CLProgram com.jogamp.opencl.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.

See also
CompilerOptions
Parameters
devicesA list of devices this program should be build on or null for all devices of its context.
Returns
this

Definition at line 313 of file CLProgram.java.

Here is the call graph for this function:

◆ build() [10/10]

CLProgram com.jogamp.opencl.CLProgram.build ( final String...  options)

Builds this program for all devices associated with the context using the specified build options.

See also
CompilerOptions

Definition at line 290 of file CLProgram.java.

Here is the call graph for this function:

◆ createCLKernel()

CLKernel com.jogamp.opencl.CLProgram.createCLKernel ( final String  kernelName)

Creates a kernel with the specified kernel name.

Definition at line 410 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCLKernels()

Map< String, CLKernel > com.jogamp.opencl.CLProgram.createCLKernels ( )

Creates all kernels of this program and stores them a Map with the kernel name as key.

Definition at line 430 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ define() [1/2]

static String com.jogamp.opencl.CLProgram.define ( final String  name)
static

Utility method for defining macros as build options (Returns "-D name").

Definition at line 687 of file CLProgram.java.

Here is the caller graph for this function:

◆ define() [2/2]

static String com.jogamp.opencl.CLProgram.define ( final String  name,
final Object  value 
)
static

Utility method for defining macros as build options (Returns "-D name=value").

Definition at line 694 of file CLProgram.java.

◆ equals()

boolean com.jogamp.opencl.CLProgram.equals ( final Object  obj)

Definition at line 705 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBinaries()

Map< CLDevice, byte[]> com.jogamp.opencl.CLProgram.getBinaries ( )

Returns the binaries for this program in an ordered Map containing the device as key and the program binaries as value.

Definition at line 624 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBuildLog() [1/2]

String com.jogamp.opencl.CLProgram.getBuildLog ( )

Returns the build log of this program on all devices.

The contents of the log are implementation dependent.

Definition at line 538 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBuildLog() [2/2]

String com.jogamp.opencl.CLProgram.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.

Definition at line 582 of file CLProgram.java.

◆ getBuildStatus() [1/2]

Map< CLDevice, Status > com.jogamp.opencl.CLProgram.getBuildStatus ( )

Returns the build status enum of this program for each device as Map.

Definition at line 558 of file CLProgram.java.

Here is the caller graph for this function:

◆ getBuildStatus() [2/2]

Status com.jogamp.opencl.CLProgram.getBuildStatus ( final CLDevice  device)

Returns the build status enum for this program on the specified device.

Definition at line 589 of file CLProgram.java.

Here is the call graph for this function:

◆ getCLDevices()

CLDevice[] com.jogamp.opencl.CLProgram.getCLDevices ( )

Returns all devices associated with this program.

Definition at line 507 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSource()

String com.jogamp.opencl.CLProgram.getSource ( )

Returns the source code of this program.

Note: sources are not cached, each call of this method calls into Open

Definition at line 609 of file CLProgram.java.

Here is the caller graph for this function:

◆ hashCode()

int com.jogamp.opencl.CLProgram.hashCode ( )

Definition at line 723 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isExecutable()

boolean com.jogamp.opencl.CLProgram.isExecutable ( )

Returns true if the build status 'BUILD_SUCCESS' for at least one device of this program exists.

Definition at line 570 of file CLProgram.java.

Here is the caller graph for this function:

◆ optionsOf()

static String com.jogamp.opencl.CLProgram.optionsOf ( final String...  options)
static

Utility method which builds a properly seperated option string.

Definition at line 674 of file CLProgram.java.

Here is the caller graph for this function:

◆ prepare()

CLProgramConfiguration com.jogamp.opencl.CLProgram.prepare ( )

Prepares the build for this program by returning a new CLProgramConfiguration.

Definition at line 403 of file CLProgram.java.

Here is the call graph for this function:

◆ release()

void com.jogamp.opencl.CLProgram.release ( )

Releases this program with its kernels.

Implements com.jogamp.opencl.CLResource.

Definition at line 478 of file CLProgram.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNoSource()

void com.jogamp.opencl.CLProgram.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.

Definition at line 601 of file CLProgram.java.

Here is the caller graph for this function:

◆ toString()

String com.jogamp.opencl.CLProgram.toString ( )

Reimplemented from com.jogamp.opencl.CLObject.

Definition at line 699 of file CLProgram.java.

Here is the call graph for this function:

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