public class CLProgram extends CLObject
CLDevice
s.
A CLProgram must be build using one of the build methods before creating CLKernel
s.CLContext.createProgram(java.io.InputStream)
,
CLContext.createProgram(java.lang.String)
,
CLContext.createProgram(java.util.Map)
Modifier and Type | Class and Description |
---|---|
static interface |
CLProgram.CompilerOptions
Common compiler options for the OpenCL compiler.
|
static class |
CLProgram.Status |
Modifier and Type | Method and Description |
---|---|
CLProgram |
build()
Builds this program for all devices associated with the context.
|
CLProgram |
build(CLBuildListener listener)
Builds this program for all devices associated with the context.
|
CLProgram |
build(CLBuildListener listener,
CLDevice... devices)
Builds this program for the given devices.
|
CLProgram |
build(CLBuildListener listener,
String... options)
Builds this program for all devices associated with the context using the specified build options.
|
CLProgram |
build(CLBuildListener listener,
String options)
Builds this program for all devices associated with the context using the specified build options.
|
CLProgram |
build(CLBuildListener listener,
String options,
CLDevice... devices)
Builds this program for the given devices and with the specified build options.
|
CLProgram |
build(CLDevice... devices)
Builds this program for the given devices.
|
CLProgram |
build(String... options)
Builds this program for all devices associated with the context using the specified build options.
|
CLProgram |
build(String options)
Builds this program for all devices associated with the context using the specified build options.
|
CLProgram |
build(String options,
CLDevice... devices)
Builds this program for the given devices and with the specified build options.
|
void |
close()
Deprecated.
This method is not intended to be called from client code.
|
CLKernel |
createCLKernel(String kernelName)
Creates a kernel with the specified kernel name.
|
Map<String,CLKernel> |
createCLKernels()
Creates all kernels of this program and stores them a Map with the kernel name as key.
|
static String |
define(String name)
Utility method for defining macros as build options (Returns "-D name").
|
static String |
define(String name,
Object value)
Utility method for defining macros as build options (Returns "-D name=value").
|
boolean |
equals(Object obj) |
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.
|
String |
getBuildLog()
Returns the build log of this program on all devices.
|
String |
getBuildLog(CLDevice device)
Returns the build log for this program on the specified device.
|
Map<CLDevice,CLProgram.Status> |
getBuildStatus()
Returns the build status enum of this program for each device as Map.
|
CLProgram.Status |
getBuildStatus(CLDevice device)
Returns the build status enum for this program on the specified device.
|
CLDevice[] |
getCLDevices()
Returns all devices associated with this program.
|
String |
getSource()
Returns the source code of this program.
|
int |
hashCode() |
boolean |
isExecutable()
Returns true if the build status 'BUILD_SUCCESS' for at least one device
of this program exists.
|
boolean |
isReleased()
Returns true if
CLResource.release() has been called. |
static String |
optionsOf(String... options)
Utility method which builds a properly seperated option string.
|
CLProgramConfiguration |
prepare()
Prepares the build for this program by returning a new
CLProgramConfiguration . |
void |
release()
Releases this program with its kernels.
|
String |
toString() |
getContext, getID, getPlatform
public CLProgram build()
public CLProgram build(CLBuildListener listener)
listener
- A listener who is notified when the program was built.CLBuildListener
public CLProgram build(CLDevice... devices)
devices
- A list of devices this program should be build on or null for all devices of its context.public CLProgram build(CLBuildListener listener, CLDevice... devices)
listener
- A listener who is notified when the program was built.devices
- A list of devices this program should be build on or null for all devices of its context.CLBuildListener
public CLProgram build(String options)
CLProgram.CompilerOptions
public CLProgram build(CLBuildListener listener, String options)
listener
- A listener who is notified when the program was built.CLProgram.CompilerOptions
,
CLBuildListener
public CLProgram build(String... options)
CLProgram.CompilerOptions
public CLProgram build(CLBuildListener listener, String... options)
listener
- A listener who is notified when the program was built.CLProgram.CompilerOptions
,
CLBuildListener
public CLProgram build(String options, CLDevice... devices)
devices
- A list of devices this program should be build on or null for all devices of its context.CLProgram.CompilerOptions
public CLProgram build(CLBuildListener listener, String options, CLDevice... devices)
devices
- A list of devices this program should be build on or null for all devices of its context.listener
- A listener who is notified when the program was built.CLProgram.CompilerOptions
,
CLBuildListener
public CLProgramConfiguration prepare()
CLProgramConfiguration
.public CLKernel createCLKernel(String kernelName)
public Map<String,CLKernel> createCLKernels()
public void release()
release
in interface CLResource
public CLDevice[] getCLDevices()
public String getBuildLog()
public Map<CLDevice,CLProgram.Status> getBuildStatus()
public boolean isExecutable()
public String getBuildLog(CLDevice device)
public CLProgram.Status getBuildStatus(CLDevice device)
public String getSource()
public Map<CLDevice,byte[]> getBinaries()
public static String optionsOf(String... options)
public static String define(String name)
public static String define(String name, Object value)
@Deprecated public final void close()
AutoCloseable
.
Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.close
in interface AutoCloseable
AutoCloseable
public boolean isReleased()
CLResource
CLResource.release()
has been called.isReleased
in interface CLResource