summaryrefslogtreecommitdiffstats
path: root/test
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
parent9560f296e01e120279a01ad06189f71cd662ed42 (diff)
added CLVersion utility class and corresponding API.
version checks in unit tests. GLProfile.initSingleton() workaround in CLGLTest.
Diffstat (limited to 'test')
-rw-r--r--test/com/jogamp/opencl/CLCommandQueueTest.java24
-rw-r--r--test/com/jogamp/opencl/HighLevelBindingTest.java3
-rw-r--r--test/com/jogamp/opencl/gl/CLGLTest.java2
3 files changed, 27 insertions, 2 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{
diff --git a/test/com/jogamp/opencl/HighLevelBindingTest.java b/test/com/jogamp/opencl/HighLevelBindingTest.java
index e08fadc7..588be480 100644
--- a/test/com/jogamp/opencl/HighLevelBindingTest.java
+++ b/test/com/jogamp/opencl/HighLevelBindingTest.java
@@ -108,7 +108,8 @@ public class HighLevelBindingTest {
out.println(" name: "+platform.getName());
out.println(" id: "+platform.ID);
out.println(" profile: "+platform.getProfile());
- out.println(" version: "+platform.getVersion());
+ out.println(" spec version: "+platform.getSpecVersion());
+ out.println(" impl version: "+platform.getVersion().getImplVersion());
out.println(" vendor: "+platform.getVendor());
out.println(" max FLOPS device: "+platform.getMaxFlopsDevice());
out.println(" extensions: "+platform.getExtensions());
diff --git a/test/com/jogamp/opencl/gl/CLGLTest.java b/test/com/jogamp/opencl/gl/CLGLTest.java
index b7dfe1dc..1fa582b8 100644
--- a/test/com/jogamp/opencl/gl/CLGLTest.java
+++ b/test/com/jogamp/opencl/gl/CLGLTest.java
@@ -34,6 +34,8 @@ public class CLGLTest {
@BeforeClass
public static void init() {
+ GLProfile.initSingleton();
+
Display display = NewtFactory.createDisplay(null); // local display
assertNotNull(display);