From d2f1955832dda891cb6d711c43bcb59e7199a38c Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Tue, 21 Sep 2010 00:48:32 +0200 Subject: initial import of utility API for filtering platforms. --- test/com/jogamp/opencl/HighLevelBindingTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/com') diff --git a/test/com/jogamp/opencl/HighLevelBindingTest.java b/test/com/jogamp/opencl/HighLevelBindingTest.java index 0c0aa63d..695da7b2 100644 --- a/test/com/jogamp/opencl/HighLevelBindingTest.java +++ b/test/com/jogamp/opencl/HighLevelBindingTest.java @@ -22,6 +22,9 @@ import org.junit.Test; import static org.junit.Assert.*; import static java.lang.System.*; import static com.jogamp.opencl.TestUtils.*; +import static com.jogamp.opencl.util.CLPlatformFilters.*; +import static com.jogamp.opencl.CLVersion.*; +import static com.jogamp.opencl.CLDevice.Type.*; import static com.jogamp.common.nio.Buffers.*; /** @@ -163,6 +166,21 @@ public class HighLevelBindingTest { } + @Test + public void platformTest() { + + CLPlatform platformGPU = CLPlatform.getDefault(version(CL_1_0), type(GPU)); + CLPlatform platformCPU = CLPlatform.getDefault(version(CL_1_0), type(CPU)); + + if(platformGPU != null) { + assertTrue(platformGPU.listCLDevices(GPU).length > 0); + }else if(platformCPU != null) { + assertTrue(platformCPU.listCLDevices(CPU).length > 0); + }else{ + fail("please tell us about your hardware"); + } + } + @Test public void createContextTest() { -- cgit v1.2.3