aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/mbien/opencl/CLBuffer.java14
-rw-r--r--src/com/mbien/opencl/CLDevice.java24
-rw-r--r--src/com/mbien/opencl/CLImage.java8
-rw-r--r--src/com/mbien/opencl/CLImage2d.java12
-rw-r--r--src/com/mbien/opencl/CLImage3d.java12
-rw-r--r--src/com/mbien/opencl/CLMemory.java51
-rw-r--r--src/com/mbien/opencl/CLPlatform.java57
-rw-r--r--src/com/mbien/opencl/gl/CLGLBuffer.java8
-rw-r--r--src/com/mbien/opencl/gl/CLGLImage2d.java10
-rw-r--r--src/com/mbien/opencl/gl/CLGLTexture2d.java6
-rw-r--r--src/com/mbien/opencl/gl/CLGLTexture3d.java6
-rw-r--r--test/com/mbien/opencl/HighLevelBindingTest.java1
12 files changed, 148 insertions, 61 deletions
diff --git a/src/com/mbien/opencl/CLBuffer.java b/src/com/mbien/opencl/CLBuffer.java
index 1895018d..2137fb91 100644
--- a/src/com/mbien/opencl/CLBuffer.java
+++ b/src/com/mbien/opencl/CLBuffer.java
@@ -10,12 +10,12 @@ import static com.mbien.opencl.CLException.*;
*/
public class CLBuffer<B extends Buffer> extends CLMemory<B> {
- protected CLBuffer(CLContext context, long id) {
- super(context, id);
+ protected CLBuffer(CLContext context, long id, int flags) {
+ super(context, id, flags);
}
- protected CLBuffer(CLContext context, B directBuffer, long id) {
- super(context, directBuffer, id);
+ protected CLBuffer(CLContext context, B directBuffer, long id, int flags) {
+ super(context, directBuffer, id, flags);
}
@SuppressWarnings("unchecked")
@@ -31,7 +31,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
long id = cl.clCreateBuffer(context.ID, flags, size, null, result, 0);
checkForError(result[0], "can not create cl buffer");
- return new CLBuffer(context, id);
+ return new CLBuffer(context, id, flags);
}
static <B extends Buffer> CLBuffer<B> create(CLContext context, B directBuffer, int flags) {
@@ -49,12 +49,12 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
long id = cl.clCreateBuffer(context.ID, flags, sizeOfBufferElem(directBuffer)*directBuffer.capacity(), host_ptr, result, 0);
checkForError(result[0], "can not create cl buffer");
- return new CLBuffer<B>(context, directBuffer, id);
+ return new CLBuffer<B>(context, directBuffer, id, flags);
}
@Override
public <T extends Buffer> CLBuffer<T> cloneWith(T directBuffer) {
- return new CLBuffer<T>(context, directBuffer, ID);
+ return new CLBuffer<T>(context, directBuffer, ID, FLAGS);
}
}
diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java
index cae250c0..01f9211f 100644
--- a/src/com/mbien/opencl/CLDevice.java
+++ b/src/com/mbien/opencl/CLDevice.java
@@ -1,5 +1,6 @@
package com.mbien.opencl;
+import com.mbien.opencl.util.CLUtil;
import com.sun.gluegen.runtime.CPU;
import com.sun.gluegen.runtime.PointerBuffer;
import java.nio.Buffer;
@@ -9,6 +10,7 @@ import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Scanner;
import java.util.Set;
@@ -16,8 +18,8 @@ import static com.mbien.opencl.CL.*;
/**
* This object represents an OpenCL device.
- * @see CLPlatform#listCLDevices(com.mbien.opencl.CLDevice.Type)
- * @see CLPlatform#getMaxFlopsDevice(com.mbien.opencl.CLDevice.Type)
+ * @see CLPlatform#listCLDevices(com.mbien.opencl.CLDevice.Type...)
+ * @see CLPlatform#getMaxFlopsDevice(com.mbien.opencl.CLDevice.Type...)
* @see CLContext#getDevices()
* @see CLContext#getMaxFlopsDevice(com.mbien.opencl.CLDevice.Type)
* @author Michael Bien
@@ -454,6 +456,7 @@ public final class CLDevice extends CLObject {
/**
* Returns {@link #getExtensions()}.contains("cl_khr_fp16");
+ * @see #getExtensions()
*/
public boolean isHalfFPAvailable() {
return getExtensions().contains("cl_khr_fp16");
@@ -461,13 +464,23 @@ public final class CLDevice extends CLObject {
/**
* Returns {@link #getExtensions()}.contains("cl_khr_fp64");
+ * @see #getExtensions()
*/
public boolean isDoubleFPAvailable() {
return getExtensions().contains("cl_khr_fp64");
}
/**
+ * Returns {@link #getExtensions()}.contains("cl_khr_gl_sharing");
+ * @see #getExtensions()
+ */
+ public boolean isGLMemorySharingSupported() {
+ return getExtensions().contains("cl_khr_gl_sharing");
+ }
+
+ /**
* Returns true if the extension is supported on this device.
+ * @see #getExtensions()
*/
public boolean isExtensionAvailable(String extension) {
return getExtensions().contains(extension);
@@ -492,6 +505,13 @@ public final class CLDevice extends CLObject {
return extensions;
}
+ /**
+ * Returns a Map of device properties with the enum names as keys.
+ * @see CLUtil#obtainDeviceProperties(com.mbien.opencl.CLDevice)
+ */
+ public Map<String, String> getProperties() {
+ return CLUtil.obtainDeviceProperties(this);
+ }
private final class CLDeviceInfoAccessor extends CLInfoAccessor {
diff --git a/src/com/mbien/opencl/CLImage.java b/src/com/mbien/opencl/CLImage.java
index 449ec703..883a4781 100644
--- a/src/com/mbien/opencl/CLImage.java
+++ b/src/com/mbien/opencl/CLImage.java
@@ -18,12 +18,12 @@ public abstract class CLImage<B extends Buffer> extends CLMemory<B> {
public final int width;
public final int height;
- protected CLImage(CLContext context, B directBuffer, CLImageFormat format, int width, int height, long id) {
- this(context, directBuffer, format, new CLImageInfoAccessor(context.cl, id), width, height, id);
+ protected CLImage(CLContext context, B directBuffer, CLImageFormat format, int width, int height, long id, int flags) {
+ this(context, directBuffer, format, new CLImageInfoAccessor(context.cl, id), width, height, id, flags);
}
- protected CLImage(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id) {
- super(context, directBuffer, id);
+ protected CLImage(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id, int flags) {
+ super(context, directBuffer, id, flags);
this.imageInfo = accessor;
this.format = format;
this.width = width;
diff --git a/src/com/mbien/opencl/CLImage2d.java b/src/com/mbien/opencl/CLImage2d.java
index a04756b9..9345244e 100644
--- a/src/com/mbien/opencl/CLImage2d.java
+++ b/src/com/mbien/opencl/CLImage2d.java
@@ -12,12 +12,12 @@ import static com.mbien.opencl.CLException.*;
*/
public class CLImage2d<B extends Buffer> extends CLImage<B> {
- private CLImage2d(CLContext context, B directBuffer, CLImageFormat format, int width, int height, long id) {
- super(context, directBuffer, format, width, height, id);
+ private CLImage2d(CLContext context, B directBuffer, CLImageFormat format, int width, int height, long id, int flags) {
+ super(context, directBuffer, format, width, height, id, flags);
}
- protected CLImage2d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id) {
- super(context, directBuffer, format, accessor, width, height, id);
+ protected CLImage2d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id, int flags) {
+ super(context, directBuffer, format, accessor, width, height, id, flags);
}
static <B extends Buffer> CLImage2d<B> createImage(CLContext context, B directBuffer,
@@ -29,12 +29,12 @@ public class CLImage2d<B extends Buffer> extends CLImage<B> {
long id = cl.clCreateImage2D(context.ID, flags, format.getFormatImpl(), width, height, rowPitch, directBuffer, err);
checkForError(err.get(), "can not create 2d image");
- return new CLImage2d<B>(context, directBuffer, format, width, height, id);
+ return new CLImage2d<B>(context, directBuffer, format, width, height, id, flags);
}
@Override
public <T extends Buffer> CLImage2d<T> cloneWith(T directBuffer) {
- return new CLImage2d<T>(context, directBuffer, format, width, height, ID);
+ return new CLImage2d<T>(context, directBuffer, format, width, height, ID, FLAGS);
}
diff --git a/src/com/mbien/opencl/CLImage3d.java b/src/com/mbien/opencl/CLImage3d.java
index 681f4fbe..afb162c2 100644
--- a/src/com/mbien/opencl/CLImage3d.java
+++ b/src/com/mbien/opencl/CLImage3d.java
@@ -15,13 +15,13 @@ public class CLImage3d<B extends Buffer> extends CLImage<B> {
public final int depth;
- private CLImage3d(CLContext context, B directBuffer, CLImageFormat format, int width, int height, int depth, long id) {
- super(context, directBuffer, format, width, height, id);
+ private CLImage3d(CLContext context, B directBuffer, CLImageFormat format, int width, int height, int depth, long id, int flags) {
+ super(context, directBuffer, format, width, height, id, flags);
this.depth = depth;
}
- protected CLImage3d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, int depth, long id) {
- super(context, directBuffer, format, accessor, width, height, id);
+ protected CLImage3d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, int depth, long id, int flags) {
+ super(context, directBuffer, format, accessor, width, height, id, flags);
this.depth = depth;
}
@@ -35,12 +35,12 @@ public class CLImage3d<B extends Buffer> extends CLImage<B> {
long id = cl.clCreateImage3D(context.ID, flags, format.getFormatImpl(), width, height, depth, rowPitch, slicePitch, directBuffer, err);
checkForError(err.get(), "can not create 2d image");
- return new CLImage3d<B>(context, directBuffer, format, width, height, depth, id);
+ return new CLImage3d<B>(context, directBuffer, format, width, height, depth, id, flags);
}
@Override
public <T extends Buffer> CLImage3d<T> cloneWith(T directBuffer) {
- return new CLImage3d<T>(context, directBuffer, format, width, height, depth, ID);
+ return new CLImage3d<T>(context, directBuffer, format, width, height, depth, ID, FLAGS);
}
/**
diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java
index 072fbaf5..444acba2 100644
--- a/src/com/mbien/opencl/CLMemory.java
+++ b/src/com/mbien/opencl/CLMemory.java
@@ -9,6 +9,9 @@ import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
import static com.mbien.opencl.CLException.*;
import static com.mbien.opencl.gl.CLGLI.*;
@@ -20,14 +23,17 @@ import static com.mbien.opencl.gl.CLGLI.*;
public abstract class CLMemory <B extends Buffer> extends CLObject implements CLResource {
B buffer;
+ protected final int FLAGS;
- protected <Buffer> CLMemory(CLContext context, long id) {
+ protected <Buffer> CLMemory(CLContext context, long id, int flags) {
super(context, id);
+ this.FLAGS = flags;
}
- protected CLMemory(CLContext context, B directBuffer, long id) {
+ protected CLMemory(CLContext context, B directBuffer, long id, int flags) {
super(context, id);
this.buffer = directBuffer;
+ this.FLAGS = flags;
}
/**
@@ -110,6 +116,34 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL
return pb.get();
}
+ /**
+ * Returns the configuration of this memory object.
+ */
+ public EnumSet<Mem> getConfig() {
+ return Mem.valuesOf(FLAGS);
+ }
+
+ /**
+ * Returns true if this memory object was created with the {@link Mem#READ_ONLY} flag.
+ */
+ public boolean isReadOnly() {
+ return (Mem.READ_ONLY.CONFIG & FLAGS) != 0;
+ }
+
+ /**
+ * Returns true if this memory object was created with the {@link Mem#WRITE_ONLY} flag.
+ */
+ public boolean isWriteOnly() {
+ return (Mem.WRITE_ONLY.CONFIG & FLAGS) != 0;
+ }
+
+ /**
+ * Returns true if this memory object was created with the {@link Mem#READ_WRITE} flag.
+ */
+ public boolean isReadWrite() {
+ return (Mem.READ_WRITE.CONFIG & FLAGS) != 0;
+ }
+
public void release() {
int ret = cl.clReleaseMemObject(ID);
context.onMemoryReleased(this);
@@ -255,6 +289,19 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL
return null;
}
+ public static EnumSet<Mem> valuesOf(int bitfield) {
+ List<Mem> matching = new ArrayList<Mem>();
+ Mem[] values = Mem.values();
+ for (Mem value : values) {
+ if((value.CONFIG & bitfield) != 0)
+ matching.add(value);
+ }
+ if(matching.isEmpty())
+ return EnumSet.noneOf(Mem.class);
+ else
+ return EnumSet.copyOf(matching);
+ }
+
public static int flagsToInt(Mem[] flags) {
int clFlags = 0;
if (flags != null) {
diff --git a/src/com/mbien/opencl/CLPlatform.java b/src/com/mbien/opencl/CLPlatform.java
index 76284dcf..f1a35db0 100644
--- a/src/com/mbien/opencl/CLPlatform.java
+++ b/src/com/mbien/opencl/CLPlatform.java
@@ -6,8 +6,11 @@ import com.sun.gluegen.runtime.PointerBuffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
import java.util.Scanner;
import java.util.Set;
@@ -92,7 +95,7 @@ public final class CLPlatform {
/**
* Lists all physical devices available on this platform.
- * @see #listCLDevices(com.mbien.opencl.CLDevice.Type)
+ * @see #listCLDevices(com.mbien.opencl.CLDevice.Type...)
*/
public CLDevice[] listCLDevices() {
return this.listCLDevices(CLDevice.Type.ALL);
@@ -101,29 +104,37 @@ public final class CLPlatform {
/**
* Lists all physical devices available on this platform matching the given {@link CLDevice.Type}.
*/
- public CLDevice[] listCLDevices(CLDevice.Type type) {
+ public CLDevice[] listCLDevices(CLDevice.Type... types) {
IntBuffer ib = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
- //find all devices
- int ret = cl.clGetDeviceIDs(ID, type.TYPE, 0, null, ib);
+ List<CLDevice> list = new ArrayList<CLDevice>();
+ for(int t = 0; t < types.length; t++) {
+ CLDevice.Type type = types[t];
- // return an empty array rather than throwing an exception
- if(ret == CL.CL_DEVICE_NOT_FOUND) {
- return new CLDevice[0];
- }
+ //find all devices
+ int ret = cl.clGetDeviceIDs(ID, type.TYPE, 0, null, ib);
- checkForError(ret, "error while enumerating devices");
+ // return an empty array rather than throwing an exception
+ if(ret == CL.CL_DEVICE_NOT_FOUND) {
+ continue;
+ }
- PointerBuffer deviceIDs = PointerBuffer.allocateDirect(ib.get(0));
- ret = cl.clGetDeviceIDs(ID, type.TYPE, deviceIDs.capacity(), deviceIDs, null);
- checkForError(ret, "error while enumerating devices");
+ checkForError(ret, "error while enumerating devices");
- CLDevice[] devices = new CLDevice[deviceIDs.capacity()];
+ PointerBuffer deviceIDs = PointerBuffer.allocateDirect(ib.get(0));
+ ret = cl.clGetDeviceIDs(ID, type.TYPE, deviceIDs.capacity(), deviceIDs, null);
+ checkForError(ret, "error while enumerating devices");
- //print device info
- for (int i = 0; i < deviceIDs.capacity(); i++)
- devices[i] = new CLDevice(cl, deviceIDs.get(i));
+ //add device to list
+ for (int n = 0; n < deviceIDs.capacity(); n++)
+ list.add(new CLDevice(cl, deviceIDs.get(n)));
+ }
+
+ CLDevice[] devices = new CLDevice[list.size()];
+ for (int i = 0; i < list.size(); i++) {
+ devices[i] = list.get(i);
+ }
return devices;
@@ -165,7 +176,7 @@ public final class CLPlatform {
* Returns the device with maximal FLOPS from this platform.
* The device speed is estimated by calculating the product of
* MAX_COMPUTE_UNITS and MAX_CLOCK_FREQUENCY.
- * @see #getMaxFlopsDevice(com.mbien.opencl.CLDevice.Type)
+ * @see #getMaxFlopsDevice(com.mbien.opencl.CLDevice.Type...)
*/
public CLDevice getMaxFlopsDevice() {
return findMaxFlopsDevice(listCLDevices());
@@ -176,8 +187,8 @@ public final class CLPlatform {
* The device speed is estimated by calculating the product of
* MAX_COMPUTE_UNITS and MAX_CLOCK_FREQUENCY.
*/
- public CLDevice getMaxFlopsDevice(CLDevice.Type type) {
- return findMaxFlopsDevice(listCLDevices(type));
+ public CLDevice getMaxFlopsDevice(CLDevice.Type... types) {
+ return findMaxFlopsDevice(listCLDevices(types));
}
/**
@@ -235,6 +246,14 @@ public final class CLPlatform {
}
/**
+ * Returns a Map of platform properties with the enum names as keys.
+ * @see CLUtil#obtainPlatformProperties(com.mbien.opencl.CLPlatform)
+ */
+ public Map<String, String> getProperties() {
+ return CLUtil.obtainPlatformProperties(this);
+ }
+
+ /**
* Returns a info string in exchange for a key (CL_PLATFORM_*).
*/
public String getInfoString(int key) {
diff --git a/src/com/mbien/opencl/gl/CLGLBuffer.java b/src/com/mbien/opencl/gl/CLGLBuffer.java
index 15256f84..1856e2ff 100644
--- a/src/com/mbien/opencl/gl/CLGLBuffer.java
+++ b/src/com/mbien/opencl/gl/CLGLBuffer.java
@@ -19,8 +19,8 @@ public final class CLGLBuffer<B extends Buffer> extends CLBuffer<B> implements C
*/
public final int GLID;
- private CLGLBuffer(CLContext context, B directBuffer, long id, int glObject) {
- super(context, directBuffer, id);
+ private CLGLBuffer(CLContext context, B directBuffer, long id, int glObject, int flags) {
+ super(context, directBuffer, id, flags);
this.GLID = glObject;
}
@@ -34,7 +34,7 @@ public final class CLGLBuffer<B extends Buffer> extends CLBuffer<B> implements C
long id = clgli.clCreateFromGLBuffer(context.ID, flags, glObject, result, 0);
- return new CLGLBuffer<B>(context, directBuffer, id, glObject);
+ return new CLGLBuffer<B>(context, directBuffer, id, glObject, flags);
}
static <B extends Buffer> void checkBuffer(B directBuffer, int flags) throws IllegalArgumentException {
@@ -56,7 +56,7 @@ public final class CLGLBuffer<B extends Buffer> extends CLBuffer<B> implements C
@Override
public <T extends Buffer> CLGLBuffer<T> cloneWith(T directBuffer) {
- return new CLGLBuffer<T>(context, directBuffer, ID, GLID);
+ return new CLGLBuffer<T>(context, directBuffer, ID, GLID, FLAGS);
}
@Override
diff --git a/src/com/mbien/opencl/gl/CLGLImage2d.java b/src/com/mbien/opencl/gl/CLGLImage2d.java
index 46affc2e..0561e757 100644
--- a/src/com/mbien/opencl/gl/CLGLImage2d.java
+++ b/src/com/mbien/opencl/gl/CLGLImage2d.java
@@ -21,8 +21,8 @@ public class CLGLImage2d<B extends Buffer> extends CLImage2d<B> implements CLGLO
*/
public final int GLID;
- protected CLGLImage2d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id, int glid) {
- super(context, directBuffer, format, accessor, width, height, id);
+ protected CLGLImage2d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id, int glid, int flags) {
+ super(context, directBuffer, format, accessor, width, height, id, flags);
this.GLID = glid;
}
@@ -36,10 +36,10 @@ public class CLGLImage2d<B extends Buffer> extends CLImage2d<B> implements CLGLO
long id = clgli.clCreateFromGLRenderbuffer(context.ID, flags, glObject, result, 0);
- return createImage(context, id, directBuffer, glObject);
+ return createImage(context, id, directBuffer, glObject, flags);
}
- static <B extends Buffer> CLGLImage2d<B> createImage(CLContext context, long id, B directBuffer, int glObject) {
+ static <B extends Buffer> CLGLImage2d<B> createImage(CLContext context, long id, B directBuffer, int glObject, int flags) {
CLImageInfoAccessor accessor = new CLImageInfoAccessor(getCL(context), id);
CLImageFormat format = createUninitializedImageFormat();
@@ -48,7 +48,7 @@ public class CLGLImage2d<B extends Buffer> extends CLImage2d<B> implements CLGLO
int width = (int)accessor.getLong(CL_IMAGE_WIDTH);
int height = (int)accessor.getLong(CL_IMAGE_HEIGHT);
- return new CLGLImage2d<B>(context, directBuffer, format, accessor, width, height, id, glObject);
+ return new CLGLImage2d<B>(context, directBuffer, format, accessor, width, height, id, glObject, flags);
}
@Override
diff --git a/src/com/mbien/opencl/gl/CLGLTexture2d.java b/src/com/mbien/opencl/gl/CLGLTexture2d.java
index 757022bc..eec6127c 100644
--- a/src/com/mbien/opencl/gl/CLGLTexture2d.java
+++ b/src/com/mbien/opencl/gl/CLGLTexture2d.java
@@ -19,8 +19,8 @@ public class CLGLTexture2d<B extends Buffer> extends CLGLImage2d<B> implements C
public final int mipMapLevel;
- public CLGLTexture2d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int target, int mipLevel, int width, int height, long id, int glid) {
- super(context, directBuffer, format, accessor, width, height, id, glid);
+ public CLGLTexture2d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int target, int mipLevel, int width, int height, long id, int glid, int flags) {
+ super(context, directBuffer, format, accessor, width, height, id, glid, flags);
this.target = target;
this.mipMapLevel = mipLevel;
}
@@ -43,7 +43,7 @@ public class CLGLTexture2d<B extends Buffer> extends CLGLImage2d<B> implements C
int width = (int)accessor.getLong(CL_IMAGE_WIDTH);
int height = (int)accessor.getLong(CL_IMAGE_HEIGHT);
- return new CLGLTexture2d<B>(context, directBuffer, format, accessor, target, mipLevel, width, height, id, width);
+ return new CLGLTexture2d<B>(context, directBuffer, format, accessor, target, mipLevel, width, height, id, width, flags);
}
diff --git a/src/com/mbien/opencl/gl/CLGLTexture3d.java b/src/com/mbien/opencl/gl/CLGLTexture3d.java
index 39224853..e1fef3a9 100644
--- a/src/com/mbien/opencl/gl/CLGLTexture3d.java
+++ b/src/com/mbien/opencl/gl/CLGLTexture3d.java
@@ -25,8 +25,8 @@ public class CLGLTexture3d<B extends Buffer> extends CLImage3d<B> implements CLG
public final int mipMapLevel;
- private CLGLTexture3d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int target, int mipLevel, int width, int height, int depth, long id, int glid) {
- super(context, directBuffer, format, accessor, width, height, depth, id);
+ private CLGLTexture3d(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int target, int mipLevel, int width, int height, int depth, long id, int glid, int flags) {
+ super(context, directBuffer, format, accessor, width, height, depth, id, flags);
this.GLID = glid;
this.target = target;
this.mipMapLevel = mipLevel;
@@ -51,7 +51,7 @@ public class CLGLTexture3d<B extends Buffer> extends CLImage3d<B> implements CLG
int height = (int)accessor.getLong(CL_IMAGE_HEIGHT);
int depth = (int)accessor.getLong(CL_IMAGE_DEPTH);
- return new CLGLTexture3d<B>(context, directBuffer, format, accessor, target, mipLevel, width, height, depth, id, texture);
+ return new CLGLTexture3d<B>(context, directBuffer, format, accessor, target, mipLevel, width, height, depth, id, texture, flags);
}
public int getGLObjectID() {
diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java
index fd201bad..44a4a1b9 100644
--- a/test/com/mbien/opencl/HighLevelBindingTest.java
+++ b/test/com/mbien/opencl/HighLevelBindingTest.java
@@ -154,6 +154,7 @@ public class HighLevelBindingTest {
out.println(" single FP config: "+device.getSingleFPConfig());
out.println(" double FP config: "+device.getDoubleFPConfig());
out.println(" execution capabilities: "+device.getExecutionCapabilities());
+ out.println(" gl memory sharing: "+device.isGLMemorySharingSupported());
out.println(" extensions: "+device.getExtensions());
}
}