summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLPlatform.java
diff options
context:
space:
mode:
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
*/