diff options
Diffstat (limited to 'test/com/jogamp/opencl/CLCommandQueueTest.java')
-rw-r--r-- | test/com/jogamp/opencl/CLCommandQueueTest.java | 24 |
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{ |