From b9c7501cc93743b168f8bc938adadf0be7d4ff80 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sun, 4 Jul 2010 00:16:33 +0200 Subject: misc OpenCL 1.1 HLB updates. ImageFormats, getters, javadoc. --- src/com/jogamp/opencl/CLDevice.java | 87 +++++++++++++++++++++++++++++++++---- 1 file changed, 79 insertions(+), 8 deletions(-) (limited to 'src/com/jogamp/opencl/CLDevice.java') diff --git a/src/com/jogamp/opencl/CLDevice.java b/src/com/jogamp/opencl/CLDevice.java index 22fc7fcf..88b4a67f 100644 --- a/src/com/jogamp/opencl/CLDevice.java +++ b/src/com/jogamp/opencl/CLDevice.java @@ -98,12 +98,17 @@ public final class CLDevice extends CLObject { } /** - * Returns OpenCL version string. Returns the OpenCL version supported by the device. - * This version string has the following format:
- * OpenCL[space][major_version.minor_version][space][vendor-specific information] + * Returns the OpenCL version supported by the device. */ - public String getVersion() { - return deviceInfo.getString(CL_DEVICE_VERSION); + public CLVersion getVersion() { + return new CLVersion(deviceInfo.getString(CL_DEVICE_VERSION)); + } + + /** + * Returns the OpenCL-C version supported by the device. + */ + public CLVersion getCVersion() { + return new CLVersion(deviceInfo.getString(CL_DEVICE_OPENCL_C_VERSION)); } /** @@ -176,6 +181,62 @@ public final class CLDevice extends CLObject { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE); } + /** + * Native vector width size for built-in char vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeCharVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR); + } + + /** + * Native vector width size for built-in short vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeShortVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT); + } + + /** + * Native vector width size for built-in int vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeIntVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_INT); + } + + /** + * Native vector width size for built-in long vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeLongVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG); + } + + /** + * Native vector width size for built-in half vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeHalfVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF); + } + + /** + * Native vector width size for built-in float vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeFloatVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT); + } + + /** + * Native vector width size for built-in double vectors. + * The vector width is defined as the number of scalar elements that can be stored in the vector. + */ + public int getNativeDoubleVectorWidth() { + return (int)deviceInfo.getLong(CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE); + } + /** * Returns the number of parallel compute cores on the OpenCL device. * The minimum value is 1. @@ -220,8 +281,9 @@ public final class CLDevice extends CLObject { } /** - * Returns the max size in bytes of the arguments that can be passed to a kernel. - * The minimum value is 256. + * Returns the max size in bytes of the arguments that can be passed to a kernel.
+ * The minimum OpenCL 1.0 value is 256.
+ * The minimum OpenCL 1.1 value is 1024.
*/ public long getMaxParameterSize() { return deviceInfo.getLong(CL_DEVICE_MAX_PARAMETER_SIZE); @@ -242,12 +304,21 @@ public final class CLDevice extends CLObject { } /** - * Returns the local memory size in bytes. + * Returns the local memory size in bytes.
+ * The minimum OpenCL 1.0 value is 16 KB.
+ * The minimum OpenCL 1.1 value is 32 KB.
*/ public long getLocalMemSize() { return deviceInfo.getLong(CL_DEVICE_LOCAL_MEM_SIZE); } + /** + * Returns true if the device and the host have a unified memory subsystem. + */ + public boolean isMemoryUnified() { + return deviceInfo.getLong(CL_DEVICE_HOST_UNIFIED_MEMORY) == CL_TRUE; + } + /** * Returns the max size in bytes of a constant buffer allocation. * The minimum value is 64 KB. -- cgit v1.2.3