diff options
Diffstat (limited to 'src/com/mbien')
-rw-r--r-- | src/com/mbien/opencl/CLCommandQueue.java | 9 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLKernel.java | 10 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLMemory.java | 12 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java index 05042333..a33593ad 100644 --- a/src/com/mbien/opencl/CLCommandQueue.java +++ b/src/com/mbien/opencl/CLCommandQueue.java @@ -990,6 +990,15 @@ public class CLCommandQueue extends CLObject implements CLResource { } /** + * Calls {@native clFlush}. + */ + public CLCommandQueue flush() { + int ret = cl.clFlush(ID); + checkForError(ret, "can not flush command queue"); + return this; + } + + /** * Returns true only when {@link Mode#PROFILING_MODE} has been enabled. */ public boolean isProfilingEnabled() { diff --git a/src/com/mbien/opencl/CLKernel.java b/src/com/mbien/opencl/CLKernel.java index a50478aa..696007ba 100644 --- a/src/com/mbien/opencl/CLKernel.java +++ b/src/com/mbien/opencl/CLKernel.java @@ -82,6 +82,11 @@ public class CLKernel extends CLObject implements CLResource, Cloneable { return this; } + public CLKernel putNullArg(int size) { + setNullArg(argIndex++, size); + return this; + } + public CLKernel putArgs(CLMemory<?>... values) { setArgs(argIndex, values); argIndex += values.length; @@ -126,6 +131,11 @@ public class CLKernel extends CLObject implements CLResource, Cloneable { return this; } + public CLKernel setNullArg(int argumentIndex, int size) { + setArgument(argumentIndex, size, null); + return this; + } + public CLKernel setArgs(CLMemory<?>... values) { setArgs(0, values); return this; diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java index 84aeb6b1..275f39ff 100644 --- a/src/com/mbien/opencl/CLMemory.java +++ b/src/com/mbien/opencl/CLMemory.java @@ -76,7 +76,17 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL } /** - * Returns the size of the wrapped direct buffer in byte. + * Returns the capacity of the wrapped direct buffer or 0 if no buffer available. + */ + public int getCapacity() { + if(buffer == null) { + return 0; + } + return buffer.capacity(); + } + + /** + * Returns the size of the wrapped direct buffer in byte or 0 if no buffer available. */ public int getSize() { if(buffer == null) { |