summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/util
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-05-02 22:55:02 +0200
committerMichael Bien <[email protected]>2010-05-02 22:55:02 +0200
commit3b3dc4591d3690f61b9488ed74e7c9248def1fd5 (patch)
treec7c30c0a51d9a1dc22e9c52bb239b1ea96df3b07 /src/com/jogamp/opencl/util
parent59148a192446ddfefb13516d7ada72e6fa1661c7 (diff)
CLBuildListener functionality for high level bindings.
- uses low level BuildProgramCallback internally - updated tests, testing async builds
Diffstat (limited to 'src/com/jogamp/opencl/util')
-rw-r--r--src/com/jogamp/opencl/util/CLBuildConfiguration.java7
-rw-r--r--src/com/jogamp/opencl/util/CLBuildListener.java25
-rw-r--r--src/com/jogamp/opencl/util/CLProgramConfiguration.java6
3 files changed, 38 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/util/CLBuildConfiguration.java b/src/com/jogamp/opencl/util/CLBuildConfiguration.java
index 1de62637..7019f1d2 100644
--- a/src/com/jogamp/opencl/util/CLBuildConfiguration.java
+++ b/src/com/jogamp/opencl/util/CLBuildConfiguration.java
@@ -21,6 +21,13 @@ public interface CLBuildConfiguration extends Cloneable {
public CLProgram build(CLProgram program);
/**
+ * Builds or rebuilds the program.
+ * @param program The program which should be build.
+ * @param listener The callback who is notified when the program has built.
+ */
+ public CLProgram build(CLProgram program, CLBuildListener listener);
+
+ /**
* Sets the program which should be build.
*/
public CLProgramConfiguration setProgram(CLProgram program);
diff --git a/src/com/jogamp/opencl/util/CLBuildListener.java b/src/com/jogamp/opencl/util/CLBuildListener.java
new file mode 100644
index 00000000..04769bb2
--- /dev/null
+++ b/src/com/jogamp/opencl/util/CLBuildListener.java
@@ -0,0 +1,25 @@
+/*
+ * Sunday, May 02 2010 20:38
+ */
+
+package com.jogamp.opencl.util;
+
+import com.jogamp.opencl.CLProgram;
+
+/**
+ * A callback an application can register to be called when the program executable
+ * has been built (successfully or unsuccessfully).<br/>
+ * Note1: registering a build callback can make {@link CL#clBuildProgram} non blocking (OpenCL implementation dependent).<br/>
+ * Note2: the thread which calls this method is unspecified. The Application should ensure propper synchronization.
+ * @author Michael Bien
+ * @see com.jogamp.opencl.CL#clBuildProgram(long, int, com.jogamp.common.nio.PointerBuffer, java.lang.String, com.jogamp.opencl.impl.BuildProgramCallback)
+ */
+public interface CLBuildListener {
+
+ /**
+ * Called when the program executable
+ * has been built (successfully or unsuccessfully).
+ */
+ public void buildFinished(CLProgram program);
+
+}
diff --git a/src/com/jogamp/opencl/util/CLProgramConfiguration.java b/src/com/jogamp/opencl/util/CLProgramConfiguration.java
index 901e28ce..de80376b 100644
--- a/src/com/jogamp/opencl/util/CLProgramConfiguration.java
+++ b/src/com/jogamp/opencl/util/CLProgramConfiguration.java
@@ -21,6 +21,12 @@ public interface CLProgramConfiguration extends CLBuildConfiguration {
public CLProgram build();
/**
+ * Builds or rebuilds a program.
+ * @param listener The callback who will be notified when the program has built.
+ */
+ public CLProgram build(CLBuildListener listener);
+
+ /**
* Returns the program.
*/
public CLProgram getProgram();