com.jogamp.opencl.util
Interface CLBuildConfiguration

All Superinterfaces:
Cloneable
All Known Subinterfaces:
CLProgramConfiguration
All Known Implementing Classes:
CLProgramBuilder

public interface CLBuildConfiguration
extends Cloneable

Configuration representing everything needed to build an OpenCL program.

If you use save(java.io.ObjectOutputStream) to persist build configurations between JVM sessions it is highly recommended to call forDevice(com.jogamp.opencl.CLDevice) or forDevices(com.jogamp.opencl.CLDevice[]) before building the program. Driver updates or HW changes can make exact device-to-binary mapping hard, the builder will drop all unmappable binaries silently. Setting the devices explicitly will force automatic rebuilds from source in this situation.

Author:
Michael Bien
See Also:
CLProgramBuilder.createConfiguration(), CLProgramBuilder.loadConfiguration(java.io.ObjectInputStream)

Method Summary
 CLProgram build(CLProgram program)
          Builds or rebuilds the program.
 CLProgram build(CLProgram program, CLBuildListener listener)
          Builds or rebuilds the program.
 CLBuildConfiguration clone()
          Clones this configuration.
 CLBuildConfiguration forDevice(CLDevice device)
          Adds the device as build target.
 CLBuildConfiguration forDevices(CLDevice... devices)
          Adds the devices as build target.
 CLBuildConfiguration reset()
          Resets this builder's configuration like options, devices and definitions.
 CLBuildConfiguration resetDefines()
          Resets this builder's macro definitions.
 CLBuildConfiguration resetDevices()
          Resets this builder's device list.
 CLBuildConfiguration resetOptions()
          Resets this builder's configuration options.
 void save(ObjectOutputStream oos)
          Saves this configuration to the ObjectOutputStream.
 CLProgramConfiguration setProgram(CLProgram program)
          Sets the program which should be build.
 CLBuildConfiguration withDefine(String name)
          Adds the definition to the build configuration.
 CLBuildConfiguration withDefine(String name, Object value)
          Adds the definition to the build configuration.
 CLBuildConfiguration withDefines(Map<String,? extends Object> defines)
          Adds the definitions to the build configuration.
 CLBuildConfiguration withDefines(String... names)
          Adds the definitions to the build configuration.
 CLBuildConfiguration withOption(String option)
          Adds the compiler option to the build configuration.
 CLBuildConfiguration withOptions(String... options)
          Adds the compiler options to the build configuration.
 

Method Detail

build

CLProgram build(CLProgram program)
Builds or rebuilds the program.

Parameters:
program - The program which should be build.

build

CLProgram build(CLProgram program,
                CLBuildListener listener)
Builds or rebuilds the program.

Parameters:
program - The program which should be build.
listener - The callback who is notified when the program has built.

setProgram

CLProgramConfiguration setProgram(CLProgram program)
Sets the program which should be build.


forDevice

CLBuildConfiguration forDevice(CLDevice device)
Adds the device as build target.


forDevices

CLBuildConfiguration forDevices(CLDevice... devices)
Adds the devices as build target.


reset

CLBuildConfiguration reset()
Resets this builder's configuration like options, devices and definitions.


resetOptions

CLBuildConfiguration resetOptions()
Resets this builder's configuration options.


resetDefines

CLBuildConfiguration resetDefines()
Resets this builder's macro definitions.


resetDevices

CLBuildConfiguration resetDevices()
Resets this builder's device list.


withDefine

CLBuildConfiguration withDefine(String name)
Adds the definition to the build configuration.

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

withDefine

CLBuildConfiguration withDefine(String name,
                                Object value)
Adds the definition to the build configuration.

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

withDefines

CLBuildConfiguration withDefines(String... names)
Adds the definitions to the build configuration.

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

withDefines

CLBuildConfiguration withDefines(Map<String,? extends Object> defines)
Adds the definitions to the build configuration.

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

withOption

CLBuildConfiguration withOption(String option)
Adds the compiler option to the build configuration.

See Also:
CLProgram.CompilerOptions

withOptions

CLBuildConfiguration withOptions(String... options)
Adds the compiler options to the build configuration.

See Also:
CLProgram.CompilerOptions

clone

CLBuildConfiguration clone()
Clones this configuration.


save

void save(ObjectOutputStream oos)
          throws IOException
Saves this configuration to the ObjectOutputStream. The caller is responsible for closing the stream.

Throws:
IOException