aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-06-25 00:18:16 +0200
committerMichael Bien <[email protected]>2010-06-25 00:18:16 +0200
commitb6d6f75129cac5f4719d1cbfb3c0b63159086137 (patch)
treecc1780cba01108e6044e39a85832cf0df63de9d7 /test
parent735c9cbbec16457358eee7424a0533fcc1b8c64c (diff)
added CLContext.getSupportedImageFormats() methods and unit test.
Diffstat (limited to 'test')
-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 588be48..ba2b11f 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();
+ }
+
+ }
}