Jogamp
Remove use of CL*Binding interfaces
authorWade Walker <wwalker3@austin.rr.com>
Sat, 3 Oct 2015 19:14:25 +0000 (14:14 -0500)
committerWade Walker <wwalker3@austin.rr.com>
Sun, 8 Nov 2015 20:05:30 +0000 (14:05 -0600)
In preparation for removing the interfaces themselves

15 files changed:
src/com/jogamp/opencl/CLBuffer.java
src/com/jogamp/opencl/CLCommandQueue.java
src/com/jogamp/opencl/CLContext.java
src/com/jogamp/opencl/CLDevice.java
src/com/jogamp/opencl/CLEvent.java
src/com/jogamp/opencl/CLEventList.java
src/com/jogamp/opencl/CLImage.java
src/com/jogamp/opencl/CLImage2d.java
src/com/jogamp/opencl/CLImage3d.java
src/com/jogamp/opencl/CLKernel.java
src/com/jogamp/opencl/CLMemory.java
src/com/jogamp/opencl/CLPlatform.java
src/com/jogamp/opencl/CLProgram.java
src/com/jogamp/opencl/CLSampler.java
src/com/jogamp/opencl/CLUserEvent.java

index 21338b0..065de07 100644 (file)
@@ -34,7 +34,6 @@ import java.util.List;
 
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.opencl.llb.CL;
-import com.jogamp.opencl.llb.CLBufferBinding;
 
 import java.nio.Buffer;
 import java.util.ArrayList;
@@ -63,7 +62,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
             throw new IllegalArgumentException("no host pointer defined");
         }
 
-        final CLBufferBinding binding = context.getPlatform().getBufferBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final int[] result = new int[1];
         final long id = binding.clCreateBuffer(context.ID, flags, size, null, result, 0);
         CLException.checkForError(result[0], "can not create cl buffer");
@@ -81,7 +80,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
             host_ptr = directBuffer;
         }
 
-        final CLBufferBinding binding = context.getPlatform().getBufferBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final int[] result = new int[1];
         final int size = Buffers.sizeOfBufferElem(directBuffer) * directBuffer.capacity();
         final long id = binding.clCreateBuffer(context.ID, flags, size, host_ptr, result, 0);
@@ -116,7 +115,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
         info.put(1, size);
         final int bitset = Mem.flagsToInt(flags);
 
-        final CLBufferBinding binding = getPlatform().getBufferBinding();
+        final CL binding = getPlatform().getCLBinding();
         final int[] err = new int[1];
         final long subID = binding.clCreateSubBuffer(ID, bitset, CL.CL_BUFFER_CREATE_TYPE_REGION, info.getBuffer(), err, 0);
         CLException.checkForError(err[0], "can not create sub buffer");
index 6e9e295..5dda094 100644 (file)
@@ -31,8 +31,8 @@ package com.jogamp.opencl;
 import static com.jogamp.opencl.CLException.checkForError;
 import static com.jogamp.opencl.CLException.newException;
 import static com.jogamp.opencl.llb.CL.CL_SUCCESS;
-import static com.jogamp.opencl.llb.CLCommandQueueBinding.CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
-import static com.jogamp.opencl.llb.CLCommandQueueBinding.CL_QUEUE_PROFILING_ENABLE;
+import static com.jogamp.opencl.llb.CL.CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
+import static com.jogamp.opencl.llb.CL.CL_QUEUE_PROFILING_ENABLE;
 import static com.jogamp.opencl.util.CLUtil.clBoolean;
 
 import java.nio.Buffer;
@@ -46,7 +46,7 @@ import java.util.List;
 import com.jogamp.common.nio.CachedBufferFactory;
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.opencl.gl.CLGLObject;
-import com.jogamp.opencl.llb.CLCommandQueueBinding;
+import com.jogamp.opencl.llb.CL;
 import com.jogamp.opencl.llb.gl.CLGL;
 
 /**
@@ -64,7 +64,7 @@ import com.jogamp.opencl.llb.gl.CLGL;
  */
 public class CLCommandQueue extends CLObjectResource {
 
-    private final CLCommandQueueBinding cl;
+    private final CL cl;
     private final CLDevice device;
     private final long properties;
 
@@ -81,7 +81,7 @@ public class CLCommandQueue extends CLObjectResource {
 
         this.device = device;
         this.properties = properties;
-        this.cl = context.getPlatform().getCommandQueueBinding();
+        this.cl = context.getPlatform().getCLBinding();
 
         final int pbsize = PointerBuffer.ELEMENT_SIZE;
         final CachedBufferFactory factory = CachedBufferFactory.create(9*pbsize + 4, true);
@@ -96,7 +96,7 @@ public class CLCommandQueue extends CLObjectResource {
 
     static CLCommandQueue create(final CLContext context, final CLDevice device, final long properties) {
         final int[] status = new int[1];
-        final CLCommandQueueBinding binding = context.getPlatform().getCommandQueueBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final long id = binding.clCreateCommandQueue(context.ID, device.ID, properties, status, 0);
 
         if(status[0] != CL_SUCCESS) {
index dc92172..310a36b 100644 (file)
@@ -56,8 +56,6 @@ import com.jogamp.opencl.CLMemory.Mem;
 import com.jogamp.opencl.CLSampler.AddressingMode;
 import com.jogamp.opencl.CLSampler.FilteringMode;
 import com.jogamp.opencl.llb.CL;
-import com.jogamp.opencl.llb.CLContextBinding;
-import com.jogamp.opencl.llb.CLMemObjBinding;
 import com.jogamp.opencl.llb.impl.CLImageFormatImpl;
 
 /**
@@ -114,17 +112,17 @@ public class CLContext extends CLObjectResource {
 
     }
 
-    private synchronized void initDevices(final CLContextBinding cl) {
+    private synchronized void initDevices(final CL cl) {
 
         if (devices == null) {
 
             final PointerBuffer deviceCount = PointerBuffer.allocateDirect(1);
 
-            int ret = cl.clGetContextInfo(ID, CLContextBinding.CL_CONTEXT_DEVICES, 0, null, deviceCount);
+            int ret = cl.clGetContextInfo(ID, CL.CL_CONTEXT_DEVICES, 0, null, deviceCount);
             CLException.checkForError(ret, "can not enumerate devices");
 
             final ByteBuffer deviceIDs = Buffers.newDirectByteBuffer((int)deviceCount.get());
-            ret = cl.clGetContextInfo(ID, CLContextBinding.CL_CONTEXT_DEVICES, deviceIDs.capacity(), deviceIDs, null);
+            ret = cl.clGetContextInfo(ID, CL.CL_CONTEXT_DEVICES, deviceIDs.capacity(), deviceIDs, null);
             CLException.checkForError(ret, "can not enumerate devices");
 
             devices = new CLDevice[deviceIDs.capacity() / (Platform.is32Bit() ? 4 : 8)];
@@ -200,7 +198,7 @@ public class CLContext extends CLObjectResource {
 
     protected static long createContextFromType(final CLPlatform platform, final CLErrorHandler handler, final PointerBuffer properties, final long deviceType) {
         final IntBuffer status = Buffers.newDirectIntBuffer(1);
-        final CLContextBinding cl = platform.getContextBinding();
+        final CL cl = platform.getCLBinding();
         final long context = cl.clCreateContextFromType(properties, deviceType, handler, status);
 
         CLException.checkForError(status.get(), "can not create CL context");
@@ -221,7 +219,7 @@ public class CLContext extends CLObjectResource {
                 pb.put(i, device.ID);
             }
         }
-        final CLContextBinding cl = platform.getContextBinding();
+        final CL cl = platform.getCLBinding();
         final long context = cl.clCreateContext(properties, pb, handler, status);
 
         CLException.checkForError(status.get(), "can not create CL context");
@@ -234,7 +232,7 @@ public class CLContext extends CLObjectResource {
             throw new RuntimeException("no OpenCL installation found");
         }
 
-        return PointerBuffer.allocateDirect(3).put(CLContextBinding.CL_CONTEXT_PLATFORM)
+        return PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM)
                                               .put(platform.ID).put(0) // 0 terminated array
                                               .rewind();
     }
@@ -508,7 +506,7 @@ public class CLContext extends CLObjectResource {
             }
 
         } finally {
-            final int ret = platform.getContextBinding().clReleaseContext(ID);
+            final int ret = platform.getCLBinding().clReleaseContext(ID);
             CLException.checkForError(ret, "error releasing context");
         }
 
@@ -520,7 +518,7 @@ public class CLContext extends CLObjectResource {
 
     private CLImageFormat[] getSupportedImageFormats(final int flags, final int type) {
 
-        final CLContextBinding binding = platform.getContextBinding();
+        final CL binding = platform.getCLBinding();
 
         final int[] entries = new int[1];
         int ret = binding.clGetSupportedImageFormats(ID, flags, type, 0, null, entries, 0);
@@ -554,14 +552,14 @@ public class CLContext extends CLObjectResource {
      * Returns all supported 2d image formats with the (optional) memory allocation flags.
      */
     public CLImageFormat[] getSupportedImage2dFormats(final Mem... flags) {
-        return getSupportedImageFormats(flags==null?0:Mem.flagsToInt(flags), CLMemObjBinding.CL_MEM_OBJECT_IMAGE2D);
+        return getSupportedImageFormats(flags==null?0:Mem.flagsToInt(flags), CL.CL_MEM_OBJECT_IMAGE2D);
     }
 
     /**
      * Returns all supported 3d image formats with the (optional) memory allocation flags.
      */
     public CLImageFormat[] getSupportedImage3dFormats(final Mem... flags) {
-        return getSupportedImageFormats(flags==null?0:Mem.flagsToInt(flags), CLMemObjBinding.CL_MEM_OBJECT_IMAGE3D);
+        return getSupportedImageFormats(flags==null?0:Mem.flagsToInt(flags), CL.CL_MEM_OBJECT_IMAGE3D);
     }
 
     /**
@@ -638,7 +636,7 @@ public class CLContext extends CLObjectResource {
      * Returns all devices associated with this CLContext.
      */
     public CLDevice[] getDevices() {
-        initDevices(platform.getContextBinding());
+        initDevices(platform.getCLBinding());
         return devices;
     }
 
index bac93cc..e33579b 100644 (file)
@@ -39,7 +39,6 @@ import java.util.Scanner;
 import java.util.Set;
 
 import com.jogamp.opencl.llb.CL;
-import com.jogamp.opencl.llb.CLDeviceBinding;
 import com.jogamp.opencl.spi.CLInfoAccessor;
 import com.jogamp.opencl.util.CLUtil;
 
@@ -61,13 +60,13 @@ public class CLDevice extends CLObject {
     protected CLDevice(final CLPlatform platform, final long id) {
         super(id);
         this.platform = platform;
-        this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(platform.getDeviceBinding(), id);
+        this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(platform.getCLBinding(), id);
     }
 
     protected CLDevice(final CLContext context, final long id) {
         super(context, id);
         this.platform = context.getPlatform();
-        this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(platform.getDeviceBinding(), id);
+        this.deviceInfo = platform.getAccessorFactory().createDeviceInfoAccessor(platform.getCLBinding(), id);
     }
 
     public CLCommandQueue createCommandQueue() {
@@ -109,7 +108,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NAME")
     public String getName() {
-        return deviceInfo.getString(CLDeviceBinding.CL_DEVICE_NAME);
+        return deviceInfo.getString(CL.CL_DEVICE_NAME);
     }
 
     /**
@@ -117,7 +116,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PROFILE")
     public String getProfile() {
-        return deviceInfo.getString(CLDeviceBinding.CL_DEVICE_PROFILE);
+        return deviceInfo.getString(CL.CL_DEVICE_PROFILE);
     }
 
     /**
@@ -125,7 +124,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_VENDOR")
     public String getVendor() {
-        return deviceInfo.getString(CLDeviceBinding.CL_DEVICE_VENDOR);
+        return deviceInfo.getString(CL.CL_DEVICE_VENDOR);
     }
 
     /**
@@ -133,7 +132,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_VENDOR_ID")
     public long getVendorID() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_VENDOR_ID);
+        return deviceInfo.getLong(CL.CL_DEVICE_VENDOR_ID);
     }
 
     /**
@@ -141,7 +140,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_VERSION")
     public CLVersion getVersion() {
-        return new CLVersion(deviceInfo.getString(CLDeviceBinding.CL_DEVICE_VERSION));
+        return new CLVersion(deviceInfo.getString(CL.CL_DEVICE_VERSION));
     }
 
     /**
@@ -149,7 +148,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_OPENCL_C_VERSION")
     public CLVersion getCVersion() {
-        return new CLVersion(deviceInfo.getString(CLDeviceBinding.CL_DEVICE_OPENCL_C_VERSION));
+        return new CLVersion(deviceInfo.getString(CL.CL_DEVICE_OPENCL_C_VERSION));
     }
 
     /**
@@ -165,7 +164,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_TYPE")
     public Type getType() {
-        return Type.valueOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_TYPE));
+        return Type.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_TYPE));
     }
 
     /**
@@ -174,7 +173,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_ADDRESS_BITS")
     public int getAddressBits() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_ADDRESS_BITS);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_ADDRESS_BITS);
     }
 
     /**
@@ -183,7 +182,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT")
     public int getPreferredShortVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT);
     }
 
     /**
@@ -192,7 +191,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR")
     public int getPreferredCharVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR);
     }
 
     /**
@@ -201,7 +200,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT")
     public int getPreferredIntVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT);
     }
 
     /**
@@ -210,7 +209,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG")
     public int getPreferredLongVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG);
     }
 
     /**
@@ -219,7 +218,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT")
     public int getPreferredFloatVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT);
     }
 
     /**
@@ -228,7 +227,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE")
     public int getPreferredDoubleVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE);
     }
 
     /**
@@ -237,7 +236,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR")
     public int getNativeCharVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR);
     }
 
     /**
@@ -246,7 +245,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT")
     public int getNativeShortVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT);
     }
 
     /**
@@ -255,7 +254,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_INT")
     public int getNativeIntVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_INT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_INT);
     }
 
     /**
@@ -264,7 +263,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG")
     public int getNativeLongVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG);
     }
 
     /**
@@ -273,7 +272,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF")
     public int getNativeHalfVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF);
     }
 
     /**
@@ -282,7 +281,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT")
     public int getNativeFloatVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT);
     }
 
     /**
@@ -291,7 +290,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE")
     public int getNativeDoubleVectorWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE);
     }
 
     /**
@@ -300,7 +299,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_COMPUTE_UNITS")
     public int getMaxComputeUnits() {
-        return (int) deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_COMPUTE_UNITS);
+        return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_COMPUTE_UNITS);
     }
 
     /**
@@ -310,7 +309,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_WORK_GROUP_SIZE")
     public int getMaxWorkGroupSize() {
-        return (int) deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_WORK_GROUP_SIZE);
+        return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_WORK_GROUP_SIZE);
     }
 
     /**
@@ -318,7 +317,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_CLOCK_FREQUENCY")
     public int getMaxClockFrequency() {
-        return (int) (deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_CLOCK_FREQUENCY));
+        return (int) (deviceInfo.getLong(CL.CL_DEVICE_MAX_CLOCK_FREQUENCY));
     }
 
     /**
@@ -328,7 +327,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS")
     public int getMaxWorkItemDimensions() {
-        return (int) deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
+        return (int) deviceInfo.getLong(CL.CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
     }
 
     /**
@@ -339,7 +338,7 @@ public class CLDevice extends CLObject {
     @CLProperty("CL_DEVICE_MAX_WORK_ITEM_SIZES")
     public int[] getMaxWorkItemSizes() {
         final int n = getMaxWorkItemDimensions();
-        return deviceInfo.getInts(CLDeviceBinding.CL_DEVICE_MAX_WORK_ITEM_SIZES, n);
+        return deviceInfo.getInts(CL.CL_DEVICE_MAX_WORK_ITEM_SIZES, n);
     }
 
     /**
@@ -349,7 +348,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_PARAMETER_SIZE")
     public long getMaxParameterSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_PARAMETER_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_MAX_PARAMETER_SIZE);
     }
 
     /**
@@ -357,7 +356,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_MEM_ALLOC_SIZE")
     public long getMaxMemAllocSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_MEM_ALLOC_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_MAX_MEM_ALLOC_SIZE);
     }
 
     /**
@@ -366,7 +365,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MEM_BASE_ADDR_ALIGN")
     public long getMemBaseAddrAlign() {
-        return deviceInfo.getUInt32Long(CLDeviceBinding.CL_DEVICE_MEM_BASE_ADDR_ALIGN);
+        return deviceInfo.getUInt32Long(CL.CL_DEVICE_MEM_BASE_ADDR_ALIGN);
     }
 
     /**
@@ -374,7 +373,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_GLOBAL_MEM_SIZE")
     public long getGlobalMemSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_GLOBAL_MEM_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_SIZE);
     }
 
     /**
@@ -384,7 +383,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_LOCAL_MEM_SIZE")
     public long getLocalMemSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_LOCAL_MEM_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_LOCAL_MEM_SIZE);
     }
 
     /**
@@ -392,7 +391,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_HOST_UNIFIED_MEMORY")
     public boolean isMemoryUnified() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_HOST_UNIFIED_MEMORY) == CL.CL_TRUE;
+        return deviceInfo.getLong(CL.CL_DEVICE_HOST_UNIFIED_MEMORY) == CL.CL_TRUE;
     }
 
     /**
@@ -401,7 +400,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE")
     public long getMaxConstantBufferSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE);
     }
 
     /**
@@ -409,7 +408,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE")
     public long getGlobalMemCachelineSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE);
     }
 
     /**
@@ -417,7 +416,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_GLOBAL_MEM_CACHE_SIZE")
     public long getGlobalMemCacheSize() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_GLOBAL_MEM_CACHE_SIZE);
+        return deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHE_SIZE);
     }
 
     /**
@@ -426,7 +425,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_CONSTANT_ARGS")
     public long getMaxConstantArgs() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_CONSTANT_ARGS);
+        return deviceInfo.getLong(CL.CL_DEVICE_MAX_CONSTANT_ARGS);
     }
 
     /**
@@ -434,7 +433,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_IMAGE_SUPPORT")
     public boolean isImageSupportAvailable() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_IMAGE_SUPPORT) == CL.CL_TRUE;
+        return deviceInfo.getLong(CL.CL_DEVICE_IMAGE_SUPPORT) == CL.CL_TRUE;
     }
 
     /**
@@ -443,7 +442,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_READ_IMAGE_ARGS")
     public int getMaxReadImageArgs() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_READ_IMAGE_ARGS);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_READ_IMAGE_ARGS);
     }
 
     /**
@@ -452,7 +451,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_WRITE_IMAGE_ARGS")
     public int getMaxWriteImageArgs() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_WRITE_IMAGE_ARGS);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_WRITE_IMAGE_ARGS);
     }
 
     /**
@@ -461,7 +460,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_IMAGE2D_MAX_WIDTH")
     public int getMaxImage2dWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_IMAGE2D_MAX_WIDTH);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE2D_MAX_WIDTH);
     }
 
     /**
@@ -470,7 +469,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_IMAGE2D_MAX_HEIGHT")
     public int getMaxImage2dHeight() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_IMAGE2D_MAX_HEIGHT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE2D_MAX_HEIGHT);
     }
 
     /**
@@ -479,7 +478,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_IMAGE3D_MAX_WIDTH")
     public int getMaxImage3dWidth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_IMAGE3D_MAX_WIDTH);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_WIDTH);
     }
 
     /**
@@ -488,7 +487,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_IMAGE3D_MAX_HEIGHT")
     public int getMaxImage3dHeight() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_IMAGE3D_MAX_HEIGHT);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_HEIGHT);
     }
 
     /**
@@ -497,7 +496,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_IMAGE3D_MAX_DEPTH")
     public int getMaxImage3dDepth() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_IMAGE3D_MAX_DEPTH);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_IMAGE3D_MAX_DEPTH);
     }
 
     /**
@@ -506,7 +505,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_MAX_SAMPLERS")
     public int getMaxSamplers() {
-        return (int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_MAX_SAMPLERS);
+        return (int)deviceInfo.getLong(CL.CL_DEVICE_MAX_SAMPLERS);
     }
 
     /**
@@ -514,7 +513,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_PROFILING_TIMER_RESOLUTION")
     public long getProfilingTimerResolution() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_PROFILING_TIMER_RESOLUTION);
+        return deviceInfo.getLong(CL.CL_DEVICE_PROFILING_TIMER_RESOLUTION);
     }
 
     /**
@@ -522,7 +521,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_EXECUTION_CAPABILITIES")
     public EnumSet<Capabilities> getExecutionCapabilities() {
-        return Capabilities.valuesOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_EXECUTION_CAPABILITIES));
+        return Capabilities.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_EXECUTION_CAPABILITIES));
     }
 
     /**
@@ -535,7 +534,7 @@ public class CLDevice extends CLObject {
     @CLProperty("CL_DEVICE_HALF_FP_CONFIG")
     public EnumSet<FPConfig> getHalfFPConfig() {
         if(isHalfFPAvailable())
-            return FPConfig.valuesOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_HALF_FP_CONFIG));
+            return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_HALF_FP_CONFIG));
         else
             return EnumSet.noneOf(FPConfig.class);
     }
@@ -548,7 +547,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_SINGLE_FP_CONFIG")
     public EnumSet<FPConfig> getSingleFPConfig() {
-        return FPConfig.valuesOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_SINGLE_FP_CONFIG));
+        return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_SINGLE_FP_CONFIG));
     }
 
     /**
@@ -561,7 +560,7 @@ public class CLDevice extends CLObject {
     @CLProperty("CL_DEVICE_DOUBLE_FP_CONFIG")
     public EnumSet<FPConfig> getDoubleFPConfig() {
         if(isDoubleFPAvailable())
-            return FPConfig.valuesOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_DOUBLE_FP_CONFIG));
+            return FPConfig.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_DOUBLE_FP_CONFIG));
         else
             return EnumSet.noneOf(FPConfig.class);
     }
@@ -571,7 +570,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_LOCAL_MEM_TYPE")
     public LocalMemType getLocalMemType() {
-        return LocalMemType.valueOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_LOCAL_MEM_TYPE));
+        return LocalMemType.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_LOCAL_MEM_TYPE));
     }
 
     /**
@@ -579,7 +578,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_GLOBAL_MEM_CACHE_TYPE")
     public GlobalMemCacheType getGlobalMemCacheType() {
-        return GlobalMemCacheType.valueOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_GLOBAL_MEM_CACHE_TYPE));
+        return GlobalMemCacheType.valueOf((int)deviceInfo.getLong(CL.CL_DEVICE_GLOBAL_MEM_CACHE_TYPE));
     }
 
 
@@ -588,7 +587,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_QUEUE_PROPERTIES")
     public EnumSet<CLCommandQueue.Mode> getQueueProperties() {
-        return CLCommandQueue.Mode.valuesOf((int)deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_QUEUE_PROPERTIES));
+        return CLCommandQueue.Mode.valuesOf((int)deviceInfo.getLong(CL.CL_DEVICE_QUEUE_PROPERTIES));
     }
 
     /**
@@ -596,7 +595,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_AVAILABLE")
     public boolean isAvailable() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_AVAILABLE) == CL.CL_TRUE;
+        return deviceInfo.getLong(CL.CL_DEVICE_AVAILABLE) == CL.CL_TRUE;
     }
 
     /**
@@ -606,7 +605,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_COMPILER_AVAILABLE")
     public boolean isCompilerAvailable() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_COMPILER_AVAILABLE) == CL.CL_TRUE;
+        return deviceInfo.getLong(CL.CL_DEVICE_COMPILER_AVAILABLE) == CL.CL_TRUE;
     }
 
     /**
@@ -614,7 +613,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_ENDIAN_LITTLE")
     public boolean isLittleEndian() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_ENDIAN_LITTLE) == CL.CL_TRUE;
+        return deviceInfo.getLong(CL.CL_DEVICE_ENDIAN_LITTLE) == CL.CL_TRUE;
     }
 
     /**
@@ -624,7 +623,7 @@ public class CLDevice extends CLObject {
      */
     @CLProperty("CL_DEVICE_ERROR_CORRECTION_SUPPORT")
     public boolean isErrorCorrectionSupported() {
-        return deviceInfo.getLong(CLDeviceBinding.CL_DEVICE_ERROR_CORRECTION_SUPPORT) == CL.CL_TRUE;
+        return deviceInfo.getLong(CL.CL_DEVICE_ERROR_CORRECTION_SUPPORT) == CL.CL_TRUE;
     }
 
     /**
@@ -690,7 +689,7 @@ public class CLDevice extends CLObject {
 
         if(extensions == null) {
             extensions = new HashSet<String>();
-            final String ext = deviceInfo.getString(CLDeviceBinding.CL_DEVICE_EXTENSIONS);
+            final String ext = deviceInfo.getString(CL.CL_DEVICE_EXTENSIONS);
             final Scanner scanner = new Scanner(ext);
 
             while(scanner.hasNext())
@@ -831,17 +830,17 @@ public class CLDevice extends CLObject {
 
         public static Type valueOf(final long clDeviceType) {
 
-            if(clDeviceType == CLDeviceBinding.CL_DEVICE_TYPE_ALL)
+            if(clDeviceType == CL.CL_DEVICE_TYPE_ALL)
                 return ALL;
 
             switch((int)clDeviceType) {
-                case(CLDeviceBinding.CL_DEVICE_TYPE_DEFAULT):
+                case(CL.CL_DEVICE_TYPE_DEFAULT):
                     return DEFAULT;
-                case(CLDeviceBinding.CL_DEVICE_TYPE_CPU):
+                case(CL.CL_DEVICE_TYPE_CPU):
                     return CPU;
-                case(CLDeviceBinding.CL_DEVICE_TYPE_GPU):
+                case(CL.CL_DEVICE_TYPE_GPU):
                     return GPU;
-                case(CLDeviceBinding.CL_DEVICE_TYPE_ACCELERATOR):
+                case(CL.CL_DEVICE_TYPE_ACCELERATOR):
                     return ACCELERATOR;
             }
             return null;
@@ -983,9 +982,9 @@ public class CLDevice extends CLObject {
          * Returns the matching LocalMemCacheType for the given cl type.
          */
         public static LocalMemType valueOf(final int clLocalCacheType) {
-            if(clLocalCacheType == CLDeviceBinding.CL_GLOBAL)
+            if(clLocalCacheType == CL.CL_GLOBAL)
                 return GLOBAL;
-            else if(clLocalCacheType == CLDeviceBinding.CL_LOCAL)
+            else if(clLocalCacheType == CL.CL_LOCAL)
                 return LOCAL;
             return null;
         }
index 2d0e556..af22e24 100644 (file)
@@ -29,7 +29,7 @@
 package com.jogamp.opencl;
 
 import com.jogamp.opencl.impl.CLTLInfoAccessor;
-import com.jogamp.opencl.llb.CLEventBinding;
+import com.jogamp.opencl.llb.CL;
 import com.jogamp.opencl.llb.impl.CLEventCallback;
 import com.jogamp.common.nio.PointerBuffer;
 import java.nio.Buffer;
@@ -49,11 +49,11 @@ public class CLEvent extends CLObjectResource {
 
     private final CLEventInfoAccessor eventInfo;
     private final CLEventProfilingInfoAccessor eventProfilingInfo;
-    private final CLEventBinding binding;
+    private final CL binding;
 
     CLEvent(final CLContext context, final long id) {
         super(context, id);
-        binding = context.getPlatform().getEventBinding();
+        binding = context.getPlatform().getCLBinding();
         this.eventInfo = new CLEventInfoAccessor();
         this.eventProfilingInfo = new CLEventProfilingInfoAccessor();
     }
index b415da0..806a066 100644 (file)
@@ -108,7 +108,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
      */
     public void waitForEvents() {
         if(size > 0) {
-            events[0].getPlatform().getEventBinding().clWaitForEvents(size, IDsView);
+            events[0].getPlatform().getCLBinding().clWaitForEvents(size, IDsView);
         }
     }
 
@@ -122,7 +122,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
         }
 
         final PointerBuffer view = getEventBuffer(start);
-        getEvent(start).getPlatform().getEventBinding().clWaitForEvents(range, view);
+        getEvent(start).getPlatform().getCLBinding().clWaitForEvents(range, view);
     }
 
     /**
@@ -130,7 +130,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
      */
     public void waitForEvent(final int index) {
         final PointerBuffer view = getEventBuffer(index);
-        getEvent(index).getPlatform().getEventBinding().clWaitForEvents(1, view);
+        getEvent(index).getPlatform().getCLBinding().clWaitForEvents(1, view);
     }
 
     /**
index 497850f..9dd19c7 100644 (file)
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
 
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.opencl.impl.CLTLInfoAccessor;
-import com.jogamp.opencl.llb.CLImageBinding;
+import com.jogamp.opencl.llb.CL;
 import java.nio.Buffer;
 
 import static com.jogamp.opencl.llb.CL.*;
@@ -61,7 +61,7 @@ public abstract class CLImage<B extends Buffer> extends CLMemory<B>  {
     }
 
     private static CLImageInfoAccessor createAccessor(final CLContext context, final long id) {
-        return new CLImageInfoAccessor(context.getPlatform().getImageBinding(), id);
+        return new CLImageInfoAccessor(context.getPlatform().getCLBinding(), id);
     }
 
     protected static CLImageFormat createUninitializedImageFormat() {
@@ -109,9 +109,9 @@ public abstract class CLImage<B extends Buffer> extends CLMemory<B>  {
     protected final static class CLImageInfoAccessor extends CLTLInfoAccessor {
 
         private final long id;
-        private final CLImageBinding cl;
+        private final CL cl;
 
-        public CLImageInfoAccessor(final CLImageBinding cl, final long id) {
+        public CLImageInfoAccessor(final CL cl, final long id) {
             this.cl = cl;
             this.id = id;
         }
index f60bb23..c684e99 100644 (file)
@@ -29,7 +29,7 @@
 package com.jogamp.opencl;
 
 import com.jogamp.common.nio.Buffers;
-import com.jogamp.opencl.llb.CLImageBinding;
+import com.jogamp.opencl.llb.CL;
 import java.nio.Buffer;
 import java.nio.IntBuffer;
 
@@ -52,7 +52,7 @@ public class CLImage2d<B extends Buffer> extends CLImage<B> {
     static <B extends Buffer> CLImage2d<B> createImage(final CLContext context, final B directBuffer,
             final int width, final int height, final int rowPitch, final CLImageFormat format, final int flags) {
 
-        final CLImageBinding cl = context.getPlatform().getImageBinding();
+        final CL cl = context.getPlatform().getCLBinding();
         final IntBuffer err = Buffers.newDirectIntBuffer(1);
         B host_ptr = null;
         if(isHostPointerFlag(flags)) {
index 9b1c7fc..6d096e5 100644 (file)
@@ -29,7 +29,7 @@
 package com.jogamp.opencl;
 
 import com.jogamp.common.nio.Buffers;
-import com.jogamp.opencl.llb.CLImageBinding;
+import com.jogamp.opencl.llb.CL;
 import java.nio.Buffer;
 import java.nio.IntBuffer;
 
@@ -58,7 +58,7 @@ public class CLImage3d<B extends Buffer> extends CLImage<B> {
     static <B extends Buffer> CLImage3d<B> createImage(final CLContext context, final B directBuffer,
             final int width, final int height, final int depth, final int rowPitch, final int slicePitch, final CLImageFormat format, final int flags) {
 
-        final CLImageBinding cl = context.getPlatform().getImageBinding();
+        final CL cl = context.getPlatform().getCLBinding();
         final IntBuffer err = Buffers.newDirectIntBuffer(1);
         B host_ptr = null;
         if(isHostPointerFlag(flags)) {
index 26f7f1d..c3031ae 100644 (file)
@@ -31,7 +31,7 @@ package com.jogamp.opencl;
 import com.jogamp.opencl.util.CLUtil;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.nio.PointerBuffer;
-import com.jogamp.opencl.llb.CLKernelBinding;
+import com.jogamp.opencl.llb.CL;
 import java.nio.Buffer;
 import java.nio.ByteBuffer;
 
@@ -56,7 +56,7 @@ public class CLKernel extends CLObjectResource implements Cloneable {
     public final int numArgs;
 
     private final CLProgram program;
-    private final CLKernelBinding binding;
+    private final CL binding;
 
     private final ByteBuffer buffer;
 
@@ -73,7 +73,7 @@ public class CLKernel extends CLObjectResource implements Cloneable {
         this.program = program;
         this.buffer = Buffers.newDirectByteBuffer((is32Bit()?4:8)*3);
 
-        binding = program.getPlatform().getKernelBinding();
+        binding = program.getPlatform().getCLBinding();
 
         if(name == null) {
             // get function name
index 9fb81e7..cf1d880 100644 (file)
@@ -28,7 +28,6 @@
 
 package com.jogamp.opencl;
 
-import com.jogamp.opencl.llb.CLMemObjBinding;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.opencl.llb.CL;
@@ -57,7 +56,7 @@ public abstract class CLMemory <B extends Buffer> extends CLObjectResource {
     protected int elementSize;
     protected int clCapacity;
 
-    private final CLMemObjBinding binding;
+    private final CL binding;
 
     protected <Buffer> CLMemory(final CLContext context, final long size, final long id, final int flags) {
         this(context, null, size, id, flags);
@@ -68,7 +67,7 @@ public abstract class CLMemory <B extends Buffer> extends CLObjectResource {
         this.buffer = directBuffer;
         this.FLAGS = flags;
         this.size = size;
-        this.binding = context.getPlatform().getMemObjectBinding();
+        this.binding = context.getPlatform().getCLBinding();
         initElementSize();
         initCLCapacity();
     }
@@ -91,7 +90,7 @@ public abstract class CLMemory <B extends Buffer> extends CLObjectResource {
 
     protected static long getSizeImpl(final CLContext context, final long id) {
         final PointerBuffer pb = PointerBuffer.allocateDirect(1);
-        final CLMemObjBinding binding = context.getPlatform().getMemObjectBinding(); // FIXME: CL separation makes this pretty complicated !
+        final CL binding = context.getPlatform().getCLBinding(); // FIXME: CL separation makes this pretty complicated !
         final int ret = binding.clGetMemObjectInfo(id, CL_MEM_SIZE, pb.elementSize(), pb.getBuffer(), null);
         checkForError(ret, "can not obtain buffer info");
         return pb.get();
index 11a562c..dfb7daf 100644 (file)
@@ -538,50 +538,6 @@ public class CLPlatform {
         return info;
     }
 
-    protected CLBufferBinding getBufferBinding() {
-        return cl;
-    }
-
-    protected CLCommandQueueBinding getCommandQueueBinding() {
-        return cl;
-    }
-
-    protected CLContextBinding getContextBinding() {
-        return cl;
-    }
-
-    protected CLDeviceBinding getDeviceBinding() {
-        return cl;
-    }
-
-    protected CLEventBinding getEventBinding() {
-        return cl;
-    }
-
-    protected CLImageBinding getImageBinding() {
-        return cl;
-    }
-
-    protected CLKernelBinding getKernelBinding() {
-        return cl;
-    }
-
-    protected CLMemObjBinding getMemObjectBinding() {
-        return cl;
-    }
-
-    protected CLPlatformBinding getPlatformBinding() {
-        return cl;
-    }
-
-    protected CLProgramBinding getProgramBinding() {
-        return cl;
-    }
-
-    protected CLSamplerBinding getSamplerBinding() {
-        return cl;
-    }
-
     protected CL getCLBinding() {
         return cl;
     }
index 7e1ef6c..6fcbc7e 100644 (file)
 package com.jogamp.opencl;
 
 import com.jogamp.common.nio.CachedBufferFactory;
-import com.jogamp.opencl.llb.CLProgramBinding;
 import com.jogamp.opencl.util.CLProgramConfiguration;
 import com.jogamp.opencl.util.CLUtil;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.nio.PointerBuffer;
-import com.jogamp.opencl.llb.CLKernelBinding;
+import com.jogamp.opencl.llb.CL;
 import com.jogamp.opencl.llb.impl.BuildProgramCallback;
 import com.jogamp.opencl.util.CLBuildListener;
 import java.nio.ByteBuffer;
@@ -63,7 +62,7 @@ import static com.jogamp.common.nio.Buffers.*;
 public class CLProgram extends CLObjectResource {
 
     private final static ReentrantLock buildLock = new ReentrantLock();
-    private final CLProgramBinding binding;
+    private final CL binding;
 
     private final Set<CLKernel> kernels;
     private Map<CLDevice, Status> buildStatusMap;
@@ -76,7 +75,7 @@ public class CLProgram extends CLObjectResource {
     private CLProgram(final CLContext context, final long id) {
         super(context, id);
         this.kernels = new HashSet<CLKernel>();
-        this.binding = context.getPlatform().getProgramBinding();
+        this.binding = context.getPlatform().getCLBinding();
     }
 
     static CLProgram create(final CLContext context, final String src) {
@@ -87,7 +86,7 @@ public class CLProgram extends CLObjectResource {
         final String[] srcArray = new String[] {src};
 
         // Create the program
-        final CLProgramBinding binding = context.getPlatform().getProgramBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final long id = binding.clCreateProgramWithSource(context.ID, 1, srcArray, length, status);
 
         final int err = status.get();
@@ -133,7 +132,7 @@ public class CLProgram extends CLObjectResource {
 
         final IntBuffer errBuffer = bf.newDirectIntBuffer(1);
 //        IntBuffer status = newDirectByteBuffer(binaries.size()*4).asIntBuffer();
-        final CLProgramBinding binding = context.getPlatform().getProgramBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final long id = binding.clCreateProgramWithBinary(context.ID, devices.capacity(), devices, lengths, codeBuffers, /*status*/null, errBuffer);
 
 //        while(status.remaining() != 0) {
@@ -218,10 +217,6 @@ public class CLProgram extends CLObjectResource {
         return buffer.getInt();
     }
 
-    private CLKernelBinding getKernelBinding() {
-        return getPlatform().getKernelBinding();
-    }
-
     /**
      * Builds this program for all devices associated with the context.
      * @return this
@@ -412,7 +407,7 @@ public class CLProgram extends CLObjectResource {
         }
 
         final int[] err = new int[1];
-        final long id = getKernelBinding().clCreateKernel(ID, kernelName, err, 0);
+        final long id = binding.clCreateKernel(ID, kernelName, err, 0);
         if(err[0] != CL_SUCCESS) {
             throw newException(err[0], "unable to create Kernel with name: "+kernelName);
         }
@@ -434,8 +429,7 @@ public class CLProgram extends CLObjectResource {
         final HashMap<String, CLKernel> newKernels = new HashMap<String, CLKernel>();
 
         final IntBuffer numKernels = newDirectByteBuffer(4).asIntBuffer();
-        final CLKernelBinding kernelBinding = getKernelBinding();
-        int ret = kernelBinding.clCreateKernelsInProgram(ID, 0, null, numKernels);
+        int ret = binding.clCreateKernelsInProgram(ID, 0, null, numKernels);
         if(ret != CL_SUCCESS) {
             throw newException(ret, "can not create kernels for "+this);
         }
@@ -443,7 +437,7 @@ public class CLProgram extends CLObjectResource {
         if(numKernels.get(0) > 0) {
 
             final PointerBuffer kernelIDs = PointerBuffer.allocateDirect(numKernels.get(0));
-            ret = kernelBinding.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null);
+            ret = binding.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null);
             if(ret != CL_SUCCESS) {
                 throw newException(ret, "can not create "+kernelIDs.capacity()+" kernels for "+this);
             }
index f3de5ff..f6fe30b 100644 (file)
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
 
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.opencl.impl.CLTLInfoAccessor;
-import com.jogamp.opencl.llb.CLSamplerBinding;
+import com.jogamp.opencl.llb.CL;
 
 import java.nio.Buffer;
 
@@ -46,18 +46,18 @@ import static com.jogamp.opencl.util.CLUtil.*;
 public class CLSampler extends CLObjectResource {
 
     private final CLSamplerInfoAccessor samplerInfo;
-    private final CLSamplerBinding binding;
+    private final CL binding;
 
     private CLSampler(final CLContext context, final long id,  final AddressingMode addrMode, final FilteringMode filtMode, final boolean normalizedCoords) {
         super(context, id);
-        this.binding = context.getPlatform().getSamplerBinding();
+        this.binding = context.getPlatform().getCLBinding();
         this.samplerInfo = new CLSamplerInfoAccessor();
     }
 
     static CLSampler create(final CLContext context, final AddressingMode addrMode, final FilteringMode filtMode, final boolean normalizedCoords) {
         final int[] error = new int[1];
 
-        final CLSamplerBinding binding = context.getPlatform().getSamplerBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final long id = binding.clCreateSampler(context.ID, clBoolean(normalizedCoords), addrMode.MODE, filtMode.MODE, error, 0);
 
         checkForError(error[0], "can not create sampler");
index cff3701..c152836 100644 (file)
@@ -34,7 +34,7 @@ package com.jogamp.opencl;
 
 import static com.jogamp.opencl.CLException.*;
 import static com.jogamp.opencl.llb.CL.*;
-import com.jogamp.opencl.llb.CLEventBinding;
+import com.jogamp.opencl.llb.CL;
 
 /**
  * Custom, user controlled event.
@@ -51,7 +51,7 @@ public class CLUserEvent extends CLEvent {
      * Creates a new user event.
      */
     public static CLUserEvent create(final CLContext context) {
-        final CLEventBinding binding = context.getPlatform().getEventBinding();
+        final CL binding = context.getPlatform().getCLBinding();
         final int[] error = new int[1];
         final long ID = binding.clCreateUserEvent(context.ID, error, 0);
         checkForError(error[0], "can not create user event.");
@@ -63,7 +63,7 @@ public class CLUserEvent extends CLEvent {
      * Calls {@native clSetUserEventStatus}.
      */
     public CLUserEvent setStatus(final CLEvent.ExecutionStatus status) {
-        final CLEventBinding binding = getPlatform().getEventBinding();
+        final CL binding = getPlatform().getCLBinding();
         final int err = binding.clSetUserEventStatus(ID, status.STATUS);
         if(err != CL_SUCCESS) {
             newException(err, "can not set status "+status);
http://JogAmp.org git info: FAQ, tutorial and man pages.