diff options
author | Michael Bien <[email protected]> | 2010-04-25 14:27:17 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-04-25 14:27:17 +0200 |
commit | f129ec5b006062e7a63cd9afbb92057b8faaeef9 (patch) | |
tree | 7c3d53d141bd795d3cfc4368ff34351e5b4290cb /src/com/jogamp | |
parent | 1be089aa2acaeef8670a5b19e7c2d08e7c87cb94 (diff) |
implemented low level BuildProgramCallbacks.
- removed userdata arguments from createContext* and buildProgram bindings
- updated LowLevelBindingTest
Diffstat (limited to 'src/com/jogamp')
-rw-r--r-- | src/com/jogamp/opencl/BuildProgramCallback.java | 13 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CLContext.java | 4 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CLProgram.java | 2 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CreateContextCallback.java | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/src/com/jogamp/opencl/BuildProgramCallback.java b/src/com/jogamp/opencl/BuildProgramCallback.java index fe2b29b9..9969c918 100644 --- a/src/com/jogamp/opencl/BuildProgramCallback.java +++ b/src/com/jogamp/opencl/BuildProgramCallback.java @@ -1,10 +1,19 @@ package com.jogamp.opencl; /** + * 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 CL#clBuildProgram(long, int, com.jogamp.common.nio.PointerBuffer, java.lang.String, com.jogamp.opencl.BuildProgramCallback) */ -// TODO implement callbacks public interface BuildProgramCallback { + + /** + * Called when the program executable + * has been built (successfully or unsuccessfully). + */ + public void buildProgramCallback(long cl_program); - public void buildProgramCallback(long cl_program, Object user_data); } diff --git a/src/com/jogamp/opencl/CLContext.java b/src/com/jogamp/opencl/CLContext.java index 4e172630..e9e0a8a8 100644 --- a/src/com/jogamp/opencl/CLContext.java +++ b/src/com/jogamp/opencl/CLContext.java @@ -146,7 +146,7 @@ public class CLContext extends CLObject implements CLResource { protected static long createContextFromType(PointerBuffer properties, long deviceType) { IntBuffer status = IntBuffer.allocate(1); - long context = CLPlatform.getLowLevelCLInterface().clCreateContextFromType(properties, deviceType, null, null, status); + long context = CLPlatform.getLowLevelCLInterface().clCreateContextFromType(properties, deviceType, null, status); checkForError(status.get(), "can not create CL context"); @@ -167,7 +167,7 @@ public class CLContext extends CLObject implements CLResource { pb.put(i, device.ID); } } - long context = CLPlatform.getLowLevelCLInterface().clCreateContext(properties, pb, null, null, status); + long context = CLPlatform.getLowLevelCLInterface().clCreateContext(properties, pb, null, status); checkForError(status.get(), "can not create CL context"); diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java index ce2b9dff..43fd9665 100644 --- a/src/com/jogamp/opencl/CLProgram.java +++ b/src/com/jogamp/opencl/CLProgram.java @@ -256,7 +256,7 @@ public class CLProgram extends CLObject implements CLResource { int ret = 0; // building programs is not threadsafe // synchronized(buildLock) { - ret = cl.clBuildProgram(ID, count, deviceIDs, options, null, null); + ret = cl.clBuildProgram(ID, count, deviceIDs, options, null); // } if(ret != CL_SUCCESS) { diff --git a/src/com/jogamp/opencl/CreateContextCallback.java b/src/com/jogamp/opencl/CreateContextCallback.java index dc25860a..a73b6298 100644 --- a/src/com/jogamp/opencl/CreateContextCallback.java +++ b/src/com/jogamp/opencl/CreateContextCallback.java @@ -9,6 +9,6 @@ import java.nio.ByteBuffer; // TODO implement callbacks public interface CreateContextCallback { - public void createContextCallback(String errinfo, ByteBuffer private_info, long cb, Object user_data); + public void createContextCallback(String errinfo, ByteBuffer private_info, long cb); } |