aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLPlatform.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-09-02 22:56:19 +0200
committerMichael Bien <[email protected]>2010-09-02 22:56:19 +0200
commit048f09aafe49e4eaddfe25ec4b302268510bc27b (patch)
tree66ae25c6f65dc228c2aa2029ef92c281e3a25c62 /src/com/jogamp/opencl/CLPlatform.java
parent0e3893e7e3e270f8231b89eaf89537cf01a43052 (diff)
CLPlatform.getDefault() returns now the platform with the latest version
Diffstat (limited to 'src/com/jogamp/opencl/CLPlatform.java')
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index 70b27a0a..802a6e9c 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -113,9 +113,13 @@ public final class CLPlatform {
*/
public static CLPlatform getDefault() {
CLPlatform[] platforms = listCLPlatforms();
- if(platforms.length > 0)
- return platforms[0];
- return null;
+ CLPlatform best = platforms[0];
+ for (CLPlatform platform : platforms) {
+ if(platform.version.compareTo(best.version) > 0) {
+ best = platform;
+ }
+ }
+ return best;
}
/**