summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLPlatform.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-06-24 23:05:04 +0200
committerMichael Bien <[email protected]>2010-06-24 23:05:04 +0200
commit735c9cbbec16457358eee7424a0533fcc1b8c64c (patch)
tree8014ee2ea69ec05f6dc25802bb0ab7f260cdc2d5 /src/com/jogamp/opencl/CLPlatform.java
parent9560f296e01e120279a01ad06189f71cd662ed42 (diff)
added CLVersion utility class and corresponding API.
version checks in unit tests. GLProfile.initSingleton() workaround in CLGLTest.
Diffstat (limited to 'src/com/jogamp/opencl/CLPlatform.java')
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java40
1 files changed, 37 insertions, 3 deletions
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index 46715feb..84d6497f 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -39,6 +39,11 @@ public final class CLPlatform {
*/
public final long ID;
+ /**
+ * Version of this OpenCL platform.
+ */
+ public final CLVersion version;
+
private static final CL cl;
private Set<String> extensions;
@@ -90,6 +95,7 @@ public final class CLPlatform {
private CLPlatform(long id) {
this.ID = id;
+ this.version = new CLVersion(getInfoString(CL_PLATFORM_VERSION));
}
/**
@@ -248,10 +254,31 @@ public final class CLPlatform {
}
/**
- * Returns the platform version.
+ * Returns the OpenCL version supported by this platform.
+ */
+ public CLVersion getVersion() {
+ return version;
+ }
+
+ /**
+ * Returns the OpenCL Specification version supported by this platform.
*/
- public String getVersion() {
- return getInfoString(CL_PLATFORM_VERSION);
+ public String getSpecVersion() {
+ return version.getSpecVersion();
+ }
+
+ /**
+ * @see CLVersion#isAtLeast(com.jogamp.opencl.CLVersion)
+ */
+ public boolean isAtLeast(CLVersion other) {
+ return version.isAtLeast(other);
+ }
+
+ /**
+ * @see CLVersion#isAtLeast(int, int)
+ */
+ public boolean isAtLeast(int major, int minor) {
+ return version.isAtLeast(major, minor);
}
/**
@@ -269,6 +296,13 @@ public final class CLPlatform {
}
/**
+ * Returns the ICD suffix.
+ */
+ public String getICDSuffix() {
+ return getInfoString(CL_PLATFORM_ICD_SUFFIX_KHR);
+ }
+
+ /**
* Returns true if the extension is supported on this platform.
*/
public boolean isExtensionAvailable(String extension) {