summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLPlatform.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-01-26 00:40:22 +0100
committerMichael Bien <[email protected]>2010-01-26 00:40:22 +0100
commitb0102cab5062eb8cb06329bff457d4dd5b9d0099 (patch)
treefdc39c89c6c55a7d41b7e4911a13c52b3a7f7d8b /src/com/mbien/opencl/CLPlatform.java
parent22a5f55a5d0e4215eacda6dbf01b34cec47a5bf0 (diff)
implemented GL interop context creation on windows and mac.
added more factory methods to CLGLContext.
Diffstat (limited to 'src/com/mbien/opencl/CLPlatform.java')
-rw-r--r--src/com/mbien/opencl/CLPlatform.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLPlatform.java b/src/com/mbien/opencl/CLPlatform.java
index 80bd4d60..fc1b78f3 100644
--- a/src/com/mbien/opencl/CLPlatform.java
+++ b/src/com/mbien/opencl/CLPlatform.java
@@ -33,6 +33,16 @@ public final class CLPlatform {
}
/**
+ * Returns the default OpenCL platform or null when no platform found.
+ */
+ public static CLPlatform getDefault() {
+ CLPlatform[] platforms = listCLPlatforms();
+ if(platforms.length > 0)
+ return platforms[0];
+ return null;
+ }
+
+ /**
* Lists all available OpenCL implementaitons.
* @throws CLException if something went wrong initializing OpenCL
*/