From b6d6f75129cac5f4719d1cbfb3c0b63159086137 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 25 Jun 2010 00:18:16 +0200 Subject: added CLContext.getSupportedImageFormats() methods and unit test. --- test/com/jogamp/opencl/HighLevelBindingTest.java | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test/com/jogamp/opencl') 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(); + } + + } } -- cgit v1.2.3