public class CLProgram extends Object
CLContext.setCacheBinaries(boolean).CLContext.createProgram(java.lang.String[])| Modifier and Type | Field and Description |
|---|---|
static boolean |
passMacrosAsSources |
| Modifier and Type | Method and Description |
|---|---|
void |
addBuildOption(String option)
Please see OpenCL's clBuildProgram documentation for details on supported build options.
|
void |
addInclude(String path)
Add a path (file or URL) to the list of paths searched for included files.
|
void |
addSource(String src) |
void |
allocate() |
CLProgram |
build()
Returns the context of this program
|
CLKernel |
createKernel(String name,
Object... args)
Calls clCreateKernel.
|
CLKernel[] |
createKernels()
Calls clCreateKernelsInProgram.
|
CLProgram |
defineMacro(String name,
Object value) |
void |
defineMacros(Map<String,Object> macros) |
boolean |
equals(Object obj)
Underyling implementation pointer-based equality test
|
Map<CLDevice,byte[]> |
getBinaries()
Get the binaries of the program (one for each device, in order)
|
CLContext |
getContext()
Returns the context of this program
|
CLDevice[] |
getDevices() |
static <E extends TypedPointer,A extends com.nativelibs4java.opencl.CLAbstractEntity> |
getEntities(A[] objects,
Pointer<E> out) |
String |
getIncludedSourceContent(String path) |
URL |
getIncludedSourceURL(String path) |
String |
getSource()
Get the source code of this program
|
int |
hashCode()
Underyling implementation pointer-based hashCode computation
|
boolean |
isCached() |
static Pair<Map<CLDevice,byte[]>,String> |
readBinaries(List<CLDevice> allowedDevices,
String expectedContentSignatureString,
InputStream in) |
void |
release()
Manual release of the OpenCL resources represented by this object.
|
Map<String,URL> |
resolveInclusions() |
void |
setCached(boolean cached) |
void |
setFastRelaxedMath()
Add the -cl-fast-relaxed-math compile option.
|
void |
setFiniteMathOnly()
Add the -cl-finite-math-only compile option.
|
void |
setMadEnable()
Add the -cl-mad-enable compile option.
|
void |
setNoSignedZero()
Add the -cl-no-signed-zero compile option.
|
void |
setNVMaximumRegistryCount(int N)
Add the -cl-nv-maxrregcount=N compilation option (NVIDIA GPUs only)
Specify the maximum number of registers that GPU functions can use. |
void |
setNVOptimizationLevel(int N)
Add the -cl-nv-opt-level compilation option (NVIDIA GPUs only)
Specify optimization level (default value: 3) |
void |
setNVVerbose()
Add the -cl-nv-verbose compilation option (NVIDIA GPUs only)
Enable verbose mode. |
void |
setUnsafeMathOptimizations()
Add the -cl-unsafe-math-optimizations option.
|
void |
store(OutputStream out)
Write the compiled binaries of this program (for all devices it was compiled for), so that it can be restored later using
CLContext.loadProgram(java.io.InputStream) |
CLProgram |
undefineMacro(String name) |
static void |
writeBinaries(Map<CLDevice,byte[]> binaries,
String source,
String contentSignatureString,
OutputStream out) |
public static boolean passMacrosAsSources
public void store(OutputStream out) throws CLBuildException, IOException
CLContext.loadProgram(java.io.InputStream)out - will be closedCLBuildExceptionIOExceptionpublic static void writeBinaries(Map<CLDevice,byte[]> binaries, String source, String contentSignatureString, OutputStream out) throws IOException
IOExceptionpublic static Pair<Map<CLDevice,byte[]>,String> readBinaries(List<CLDevice> allowedDevices, String expectedContentSignatureString, InputStream in) throws IOException
IOExceptionpublic CLDevice[] getDevices()
public void allocate()
public void addInclude(String path)
"subpath/file.cl" statements.path - A file or URL that points to the root path from which includes can be resolved.public Map<String,URL> resolveInclusions() throws IOException
IOExceptionpublic String getIncludedSourceContent(String path) throws IOException
IOExceptionpublic URL getIncludedSourceURL(String path) throws MalformedURLException
MalformedURLExceptionpublic Map<CLDevice,byte[]> getBinaries() throws CLBuildException
CLBuildExceptionpublic CLContext getContext()
public CLProgram defineMacro(String name, Object value)
public CLProgram undefineMacro(String name)
public void defineMacros(Map<String,Object> macros)
public void setFastRelaxedMath()
public void setNoSignedZero()
public void setMadEnable()
public void setFiniteMathOnly()
public void setUnsafeMathOptimizations()
public void setNVVerbose()
public void setNVMaximumRegistryCount(int N)
N - positive integerpublic void setNVOptimizationLevel(int N)
N - positive integer, or 0 (no optimization).public void addBuildOption(String option)
public void setCached(boolean cached)
public boolean isCached()
public CLProgram build() throws CLBuildException
CLBuildExceptionpublic CLKernel[] createKernels() throws CLBuildException
CLBuildExceptionpublic CLKernel createKernel(String name, Object... args) throws CLBuildException
CLBuildExceptionpublic void release()
public static <E extends TypedPointer,A extends com.nativelibs4java.opencl.CLAbstractEntity> Pointer<E> getEntities(A[] objects, Pointer<E> out)
public int hashCode()
Copyright © 2009-2015. All Rights Reserved.