aboutsummaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl/CLCommandQueueTest.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 /test/com/jogamp/opencl/CLCommandQueueTest.java
parent9560f296e01e120279a01ad06189f71cd662ed42 (diff)
added CLVersion utility class and corresponding API.
version checks in unit tests. GLProfile.initSingleton() workaround in CLGLTest.
Diffstat (limited to 'test/com/jogamp/opencl/CLCommandQueueTest.java')
-rw-r--r--test/com/jogamp/opencl/CLCommandQueueTest.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/com/jogamp/opencl/CLCommandQueueTest.java b/test/com/jogamp/opencl/CLCommandQueueTest.java
index 3df894e5..0ea1cae4 100644
--- a/test/com/jogamp/opencl/CLCommandQueueTest.java
+++ b/test/com/jogamp/opencl/CLCommandQueueTest.java
@@ -12,6 +12,7 @@ import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.jogamp.opencl.TestUtils.*;
import static com.jogamp.opencl.CLEvent.*;
+import static com.jogamp.opencl.CLVersion.*;
import static com.jogamp.common.nio.Buffers.*;
/**
@@ -167,7 +168,28 @@ public class CLCommandQueueTest {
final int elements = roundUp(groupSize, ONE_MB / SIZEOF_INT * 5); // 5MB per buffer
- final CLContext context = CLContext.create();
+ // 5MB per buffer
+ CLPlatform[] platforms = CLPlatform.listCLPlatforms();
+ CLPlatform theChosenOne = platforms[0];
+ for (CLPlatform platform : platforms) {
+ if(platform.isAtLeast(CL_1_1)) {
+ theChosenOne = platform;
+ break;
+ }
+ }
+
+ final CLContext context = CLContext.create(theChosenOne);
+
+ // we expect an UOE if CL 1.1 is not supported
+ if(!theChosenOne.isAtLeast(CL_1_1)) {
+ try{
+ CLUserEvent.create(context);
+ fail("");
+ }catch(UnsupportedOperationException ex) {
+ out.println("test dissabled, required CLVersion: "+CL_1_1+" available: "+theChosenOne.getVersion());
+ return;
+ }
+ }
try{