diff options
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); |