From 4373f933333ecee50dea9686403b6f81759e3b07 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Wed, 15 Jun 2011 16:32:27 +0200 Subject: internal refactoring to use new binding interfaces in highlevel api impl. --- src/com/jogamp/opencl/CLCommandQueue.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/com/jogamp/opencl/CLCommandQueue.java') diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java index b97466d4..858a3a5b 100644 --- a/src/com/jogamp/opencl/CLCommandQueue.java +++ b/src/com/jogamp/opencl/CLCommandQueue.java @@ -32,6 +32,7 @@ import com.jogamp.common.nio.CachedBufferFactory; import com.jogamp.opencl.llb.gl.CLGL; import com.jogamp.common.nio.NativeSizeBuffer; import com.jogamp.opencl.gl.CLGLObject; +import com.jogamp.opencl.llb.CLCommandQueueBinding; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.IntBuffer; @@ -59,6 +60,7 @@ import static com.jogamp.opencl.util.CLUtil.*; */ public class CLCommandQueue extends CLObject implements CLResource { + private final CLCommandQueueBinding cl; private final CLDevice device; private long properties; @@ -75,21 +77,23 @@ public class CLCommandQueue extends CLObject implements CLResource { this.device = device; this.properties = properties; + this.cl = context.getPlatform().getCommandQueueBinding(); int pbsize = NativeSizeBuffer.elementSize(); CachedBufferFactory factory = CachedBufferFactory.create(9*pbsize + 4, true); - + this.ibA = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize)); this.ibB = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize)); this.ibC = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize)); - + this.pbA = factory.newDirectIntBuffer(1); } static CLCommandQueue create(CLContext context, CLDevice device, long properties) { int[] status = new int[1]; - long id = context.cl.clCreateCommandQueue(context.ID, device.ID, properties, status, 0); + CLCommandQueueBinding binding = context.getPlatform().getCommandQueueBinding(); + long id = binding.clCreateCommandQueue(context.ID, device.ID, properties, status, 0); if(status[0] != CL_SUCCESS) { throw newException(status[0], "can not create command queue on " + device +" with properties: " + Mode.valuesOf(properties)); -- cgit v1.2.3