diff options
author | Michael Bien <[email protected]> | 2010-02-01 01:09:18 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-02-01 01:09:18 +0100 |
commit | e4e7dc4e7a63206c091cd3288adc6a7346f74191 (patch) | |
tree | ab2435f774da803489fd58612e6b1f22a3e46cee /src/com/mbien/opencl/CLCommandQueue.java | |
parent | 2015fa5cd47b9be234f30e4b98d06b83486e4fb2 (diff) |
trivial bugfixes, typo and javadoc warning fixes.
began to switch to gluegen's libloading infrastructure.
added CL extensions accessors to CLPlatform.
optimized isFooEnabled() methods for CLCommandQueue.
Diffstat (limited to 'src/com/mbien/opencl/CLCommandQueue.java')
-rw-r--r-- | src/com/mbien/opencl/CLCommandQueue.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java index d7586a93..0967a27b 100644 --- a/src/com/mbien/opencl/CLCommandQueue.java +++ b/src/com/mbien/opencl/CLCommandQueue.java @@ -20,9 +20,11 @@ import static com.mbien.opencl.CL.*; public class CLCommandQueue implements CLResource { public final long ID; + private final CLContext context; private final CLDevice device; private final CL cl; + private long properties; /* * Those direct memory buffers are used to pass data between the JVM and OpenCL. @@ -35,6 +37,7 @@ public class CLCommandQueue implements CLResource { this.context = context; this.cl = context.cl; this.device = device; + this.properties = properties; this.bufferA = PointerBuffer.allocateDirect(3); this.bufferB = PointerBuffer.allocateDirect(3); @@ -450,7 +453,7 @@ public class CLCommandQueue implements CLResource { if(localWorkSizeX != 0 && localWorkSizeY !=0) { localWorkSize = copy2NIO(bufferC, localWorkSizeX, localWorkSizeY); } - this.putNDRangeKernel(kernel, 2, globalWorkOffset, globalWorkSize, localWorkSize); + this.putNDRangeKernel(kernel, 2, globalWorkOffset, globalWorkSize, localWorkSize, events); return this; } @@ -525,13 +528,26 @@ public class CLCommandQueue implements CLResource { return this; } - public CLCommandQueue finish() { int ret = cl.clFinish(ID); checkForError(ret, "can not finish command queue"); return this; } + /** + * Returns true only when {@link Mode#PROFILING_MODE} has been enabled. + */ + public boolean isProfilingEnabled() { + return (Mode.PROFILING_MODE.QUEUE_MODE & properties) != 0; + } + + /** + * Returns true only when {@link Mode#OUT_OF_ORDER_EXEC_MODE} mode has been enabled. + */ + public boolean isOutOfOrderModeEnabled() { + return (Mode.OUT_OF_ORDER_EXEC_MODE.QUEUE_MODE & properties) != 0; + } + public void release() { int ret = cl.clReleaseCommandQueue(ID); context.onCommandQueueReleased(device, this); |