From 735c9cbbec16457358eee7424a0533fcc1b8c64c Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 24 Jun 2010 23:05:04 +0200 Subject: added CLVersion utility class and corresponding API. version checks in unit tests. GLProfile.initSingleton() workaround in CLGLTest. --- src/com/jogamp/opencl/CLPlatform.java | 40 ++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) (limited to 'src/com/jogamp/opencl/CLPlatform.java') 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 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); } /** @@ -268,6 +295,13 @@ public final class CLPlatform { return getInfoString(CL_PLATFORM_VENDOR); } + /** + * Returns the ICD suffix. + */ + public String getICDSuffix() { + return getInfoString(CL_PLATFORM_ICD_SUFFIX_KHR); + } + /** * Returns true if the extension is supported on this platform. */ -- cgit v1.2.3