From 7f2db980b303fa75f3830679ce65fe4ae41c30dc Mon Sep 17 00:00:00 2001
From: Michael Bien <mbien@fh-landshut.de>
Date: Tue, 20 Oct 2009 00:53:50 +0200
Subject: added CLCommandQueue to CLContext's resource management code, minor
 fixes...

---
 src/com/mbien/opencl/CLCommandQueue.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/com/mbien/opencl/CLCommandQueue.java')

diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java
index ff91131b..b0a6980f 100644
--- a/src/com/mbien/opencl/CLCommandQueue.java
+++ b/src/com/mbien/opencl/CLCommandQueue.java
@@ -10,11 +10,13 @@ public class CLCommandQueue {
 
     public final long ID;
     private final CLContext context;
+    private final CLDevice device;
     private final CL cl;
 
     CLCommandQueue(CLContext context, CLDevice device, long properties) {
         this.context = context;
         this.cl = context.cl;
+        this.device = device;
 
         int[] status = new int[1];
         this.ID = cl.clCreateCommandQueue(context.ID, device.ID, properties, status, 0);
@@ -55,7 +57,7 @@ public class CLCommandQueue {
 
        int ret = cl.clEnqueueNDRangeKernel(
                 ID, kernel.ID, 1,
-                null, 0,
+                globalWorkOffset, 0,
                 globalWorkSize, 0,
                 localWorkSize, 0,
                 0,
@@ -70,6 +72,7 @@ public class CLCommandQueue {
 
     public void release() {
         int ret = cl.clReleaseCommandQueue(ID);
+        context.commandQueueReleased(device, this);
         checkForError(ret, "can not release command queue");
     }
 
-- 
cgit v1.2.3