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

CLProgramBuilder is a helper for building programs with more complex configurations or building multiple programs with similar configurations. More...

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

Public Member Functions

void save (final ObjectOutputStream oos) throws IOException
 Saves this configuration to the ObjectOutputStream. More...
 
CLProgramBuilder withOption (final String option)
 Adds the compiler option to the build configuration. More...
 
CLProgramBuilder withOptions (final String... options)
 Adds the compiler options to the build configuration. More...
 
CLProgramBuilder withDefine (final String name)
 Adds the definition to the build configuration. More...
 
CLProgramBuilder withDefines (final String... names)
 Adds the definitions to the build configuration. More...
 
CLProgramBuilder withDefine (final String name, final Object value)
 Adds the definition to the build configuration. More...
 
CLProgramBuilder withDefines (final Map< String, ? extends Object > defines)
 
CLProgramBuilder forDevice (final CLDevice device)
 Adds the device as build target. More...
 
CLProgramBuilder forDevices (final CLDevice... devices)
 Adds the devices as build target. More...
 
CLProgram build ()
 Builds or rebuilds a program. More...
 
CLProgram build (final CLBuildListener listener)
 Builds or rebuilds a program. More...
 
CLProgram build (final CLProgram program)
 Builds or rebuilds the program. More...
 
CLProgram build (final CLProgram program, final CLBuildListener listener)
 Builds or rebuilds the program. More...
 
CLProgramBuilder reset ()
 Resets this builder's configuration like options, devices and definitions. More...
 
CLProgramConfiguration resetDefines ()
 Resets this builder's macro definitions. More...
 
CLProgramConfiguration resetDevices ()
 Resets this builder's device list. More...
 
CLProgramConfiguration resetOptions ()
 Resets this builder's configuration options. More...
 
CLProgramBuilder asBuildConfiguration ()
 Returns a new instance of of this configuration without a CLProgram, program binaries or sources associated with it. More...
 
CLProgramBuilder clone ()
 Clones this configuration. More...
 
CLProgram getProgram ()
 Returns the program. More...
 
CLProgramBuilder setProgram (final CLProgram program)
 Sets the program which should be build. More...
 
String toString ()
 
boolean equals (final Object o)
 
int hashCode ()
 
- Public Member Functions inherited from com.jogamp.opencl.util.CLProgramConfiguration
CLProgram build ()
 Builds or rebuilds a program. More...
 
CLProgram build (CLBuildListener listener)
 Builds or rebuilds a program. More...
 
CLProgram getProgram ()
 Returns the program. More...
 
CLBuildConfiguration asBuildConfiguration ()
 Returns a new instance of of this configuration without a CLProgram, program binaries or sources associated with it. More...
 
CLProgramConfiguration forDevice (CLDevice device)
 Adds the device as build target. More...
 
CLProgramConfiguration forDevices (CLDevice... devices)
 Adds the devices as build target. More...
 
CLProgramConfiguration withDefine (String name)
 Adds the definition to the build configuration. More...
 
CLProgramConfiguration withDefine (String name, Object value)
 Adds the definition to the build configuration. More...
 
CLProgramConfiguration withDefines (String... names)
 Adds the definitions to the build configuration. More...
 
CLProgramConfiguration withDefines (Map< String, ? extends Object > defines)
 Adds the definitions to the build configuration. More...
 
CLProgramConfiguration withOption (String option)
 Adds the compiler option to the build configuration. More...
 
CLProgramConfiguration withOptions (String... options)
 Adds the compiler options to the build configuration. More...
 
CLProgramConfiguration reset ()
 Resets this builder's configuration like options, devices and definitions. More...
 
CLProgramConfiguration resetOptions ()
 Resets this builder's configuration options. More...
 
CLProgramConfiguration resetDefines ()
 Resets this builder's macro definitions. More...
 
CLProgramConfiguration resetDevices ()
 Resets this builder's device list. More...
 
CLProgramConfiguration clone ()
 Clones this configuration. More...
 
CLProgram build (CLProgram program)
 Builds or rebuilds the program. More...
 
CLProgram build (CLProgram program, CLBuildListener listener)
 Builds or rebuilds the program. More...
 
CLProgramConfiguration setProgram (CLProgram program)
 Sets the program which should be build. More...
 
CLBuildConfiguration forDevice (CLDevice device)
 Adds the device as build target. More...
 
CLBuildConfiguration forDevices (CLDevice... devices)
 Adds the devices as build target. More...
 
CLBuildConfiguration reset ()
 Resets this builder's configuration like options, devices and definitions. More...
 
CLBuildConfiguration resetOptions ()
 Resets this builder's configuration options. More...
 
CLBuildConfiguration resetDefines ()
 Resets this builder's macro definitions. More...
 
CLBuildConfiguration resetDevices ()
 Resets this builder's device list. More...
 
CLBuildConfiguration withDefine (String name)
 Adds the definition to the build configuration. More...
 
CLBuildConfiguration withDefine (String name, Object value)
 Adds the definition to the build configuration. More...
 
CLBuildConfiguration withDefines (String... names)
 Adds the definitions to the build configuration. More...
 
CLBuildConfiguration withDefines (Map< String, ? extends Object > defines)
 Adds the definitions to the build configuration. More...
 
CLBuildConfiguration withOption (String option)
 Adds the compiler option to the build configuration. More...
 
CLBuildConfiguration withOptions (String... options)
 Adds the compiler options to the build configuration. More...
 
CLBuildConfiguration clone ()
 Clones this configuration. More...
 
void save (ObjectOutputStream oos) throws IOException
 Saves this configuration to the ObjectOutputStream. More...
 

Static Public Member Functions

static CLBuildConfiguration createConfiguration ()
 Creates a new CLBuildConfiguration. More...
 
static CLProgramConfiguration createConfiguration (final CLProgram program)
 Creates a new CLProgramConfiguration for this program. More...
 
static CLBuildConfiguration loadConfiguration (final ObjectInputStream ois) throws IOException, ClassNotFoundException
 Loads a CLBuildConfiguration. More...
 
static CLProgramConfiguration loadConfiguration (final ObjectInputStream ois, final CLContext context) throws IOException, ClassNotFoundException
 Loads a CLProgramConfiguration containing a CLProgram. More...
 

Detailed Description

CLProgramBuilder is a helper for building programs with more complex configurations or building multiple programs with similar configurations.

CLProgramBuilder is used to create CLProgramConfigurations and CLBuildConfigurations.

See also
CLProgram::prepare()
createConfiguration()
createConfiguration(com.jogamp.opencl.CLProgram)
loadConfiguration(java.io.ObjectInputStream)
loadConfiguration(java.io.ObjectInputStream, com.jogamp.opencl.CLContext)
Author
Michael Bien

Definition at line 60 of file CLProgramBuilder.java.

Member Function Documentation

◆ asBuildConfiguration()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.asBuildConfiguration ( )

Returns a new instance of of this configuration without a CLProgram, program binaries or sources associated with it.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 342 of file CLProgramBuilder.java.

◆ build() [1/4]

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

Builds or rebuilds a program.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 222 of file CLProgramBuilder.java.

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

◆ build() [2/4]

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

Builds or rebuilds a program.

Parameters
listenerThe callback who will be notified when the program has built.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 227 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ build() [3/4]

CLProgram com.jogamp.opencl.CLProgramBuilder.build ( final CLProgram  program)

Builds or rebuilds the program.

Parameters
programThe program which should be build.

Implements com.jogamp.opencl.util.CLBuildConfiguration.

Definition at line 232 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ build() [4/4]

CLProgram com.jogamp.opencl.CLProgramBuilder.build ( final CLProgram  program,
final CLBuildListener  listener 
)

Builds or rebuilds the program.

Parameters
programThe program which should be build.
listenerThe callback who is notified when the program has built.

Implements com.jogamp.opencl.util.CLBuildConfiguration.

Definition at line 237 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ clone()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.clone ( )

Clones this configuration.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 350 of file CLProgramBuilder.java.

◆ createConfiguration() [1/2]

static CLBuildConfiguration com.jogamp.opencl.CLProgramBuilder.createConfiguration ( )
static

Creates a new CLBuildConfiguration.

Definition at line 94 of file CLProgramBuilder.java.

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

◆ createConfiguration() [2/2]

static CLProgramConfiguration com.jogamp.opencl.CLProgramBuilder.createConfiguration ( final CLProgram  program)
static

Creates a new CLProgramConfiguration for this program.

Definition at line 101 of file CLProgramBuilder.java.

◆ equals()

boolean com.jogamp.opencl.CLProgramBuilder.equals ( final Object  o)

Definition at line 380 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ forDevice()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.forDevice ( final CLDevice  device)

Adds the device as build target.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 206 of file CLProgramBuilder.java.

Here is the caller graph for this function:

◆ forDevices()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.forDevices ( final CLDevice...  devices)

Adds the devices as build target.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 214 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ getProgram()

CLProgram com.jogamp.opencl.CLProgramBuilder.getProgram ( )

Returns the program.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 358 of file CLProgramBuilder.java.

◆ hashCode()

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

Definition at line 410 of file CLProgramBuilder.java.

◆ loadConfiguration() [1/2]

static CLBuildConfiguration com.jogamp.opencl.CLProgramBuilder.loadConfiguration ( final ObjectInputStream  ois) throws IOException, ClassNotFoundException
static

Loads a CLBuildConfiguration.

Parameters
oisThe ObjectInputStream for reading the object.

Definition at line 109 of file CLProgramBuilder.java.

◆ loadConfiguration() [2/2]

static CLProgramConfiguration com.jogamp.opencl.CLProgramBuilder.loadConfiguration ( final ObjectInputStream  ois,
final CLContext  context 
) throws IOException, ClassNotFoundException
static

Loads a CLProgramConfiguration containing a CLProgram.

The CLProgram is initialized and ready to be build after this method call. This method prefers program initialization from binaries if this fails or if no binaries have been found, it will try to load the program from sources. If this also fails an appropriate exception will be thrown.

Parameters
oisThe ObjectInputStream for reading the object.
contextThe context used for program initialization.

Definition at line 122 of file CLProgramBuilder.java.

◆ reset()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.reset ( )

Resets this builder's configuration like options, devices and definitions.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 250 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ resetDefines()

CLProgramConfiguration com.jogamp.opencl.CLProgramBuilder.resetDefines ( )

Resets this builder's macro definitions.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 258 of file CLProgramBuilder.java.

Here is the caller graph for this function:

◆ resetDevices()

CLProgramConfiguration com.jogamp.opencl.CLProgramBuilder.resetDevices ( )

Resets this builder's device list.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 264 of file CLProgramBuilder.java.

Here is the caller graph for this function:

◆ resetOptions()

CLProgramConfiguration com.jogamp.opencl.CLProgramBuilder.resetOptions ( )

Resets this builder's configuration options.

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 270 of file CLProgramBuilder.java.

Here is the caller graph for this function:

◆ save()

void com.jogamp.opencl.CLProgramBuilder.save ( final ObjectOutputStream  oos) throws IOException

Saves this configuration to the ObjectOutputStream.

The caller is responsible for closing the stream.

Implements com.jogamp.opencl.util.CLBuildConfiguration.

Definition at line 152 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ setProgram()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.setProgram ( final CLProgram  program)

Sets the program which should be build.

Implements com.jogamp.opencl.util.CLBuildConfiguration.

Definition at line 363 of file CLProgramBuilder.java.

◆ toString()

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

Definition at line 369 of file CLProgramBuilder.java.

◆ withDefine() [1/2]

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.withDefine ( final String  name)

Adds the definition to the build configuration.

See also
CLProgram::define(java.lang.String)

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 176 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ withDefine() [2/2]

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.withDefine ( final String  name,
final Object  value 
)

Adds the definition to the build configuration.

See also
CLProgram::define(java.lang.String, java.lang.Object)

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 190 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ withDefines() [1/2]

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.withDefines ( final Map< String, ? extends Object >  defines)

Definition at line 196 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ withDefines() [2/2]

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.withDefines ( final String...  names)

Adds the definitions to the build configuration.

See also
com.jogamp.opencl.CLProgram::define(java.lang.String)

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 182 of file CLProgramBuilder.java.

Here is the call graph for this function:

◆ withOption()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.withOption ( final String  option)

Adds the compiler option to the build configuration.

See also
com.jogamp.opencl.CLProgram.CompilerOptions

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 164 of file CLProgramBuilder.java.

◆ withOptions()

CLProgramBuilder com.jogamp.opencl.CLProgramBuilder.withOptions ( final String...  options)

Adds the compiler options to the build configuration.

See also
com.jogamp.opencl.CLProgram.CompilerOptions

Implements com.jogamp.opencl.util.CLProgramConfiguration.

Definition at line 170 of file CLProgramBuilder.java.


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