aboutsummaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl/HighLevelBindingTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/com/jogamp/opencl/HighLevelBindingTest.java')
-rw-r--r--test/com/jogamp/opencl/HighLevelBindingTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/com/jogamp/opencl/HighLevelBindingTest.java b/test/com/jogamp/opencl/HighLevelBindingTest.java
index 588be480..ba2b11fa 100644
--- a/test/com/jogamp/opencl/HighLevelBindingTest.java
+++ b/test/com/jogamp/opencl/HighLevelBindingTest.java
@@ -321,5 +321,34 @@ public class HighLevelBindingTest {
context.release();
}
+ @Test
+ public void supportedImageFormatsTest() {
+
+ CLDevice[] devices = CLPlatform.getDefault().listCLDevices();
+
+ CLDevice theChosenOne = null;
+ for (CLDevice device : devices) {
+ if(device.isImageSupportAvailable()) {
+ theChosenOne = device;
+ break;
+ }
+ }
+
+ if(theChosenOne == null) {
+ out.println("can not test image api.");
+ return;
+ }
+
+ CLContext context = CLContext.create(theChosenOne);
+
+ try{
+ CLImageFormat[] formats = context.getSupportedImage2dFormats();
+ assertTrue(formats.length > 0);
+ out.println("sample image format: "+formats[0]);
+ }finally{
+ context.release();
+ }
+
+ }
}