From a93e4532f9515f5b2c0d2c67a45db1236a29ab12 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 12 Feb 2010 02:15:06 +0100 Subject: fixed bug in CL[GL]Context.create(..., device), added test. CLKernel is now Cloneable. --- test/com/mbien/opencl/HighLevelBindingTest.java | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'test/com/mbien/opencl/HighLevelBindingTest.java') diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java index 9c0e2343..ec3586d7 100644 --- a/test/com/mbien/opencl/HighLevelBindingTest.java +++ b/test/com/mbien/opencl/HighLevelBindingTest.java @@ -106,6 +106,47 @@ public class HighLevelBindingTest { } + @Test + public void createContextTest() { + + out.println(" - - - highLevelTest; create context - - - "); + + CLPlatform platform = CLPlatform.getDefault(); + int deviceCount = platform.listCLDevices().length; + CLDevice firstDevice = platform.listCLDevices()[0]; + + CLContext c = CLContext.create(); + assertNotNull(c); + assertEquals(deviceCount, c.getCLDevices().length); + c.release(); + + c = CLContext.create(platform); + assertNotNull(c); + assertEquals(deviceCount, c.getCLDevices().length); + c.release(); + + c = CLContext.create(firstDevice); + assertNotNull(c); + assertEquals(1, c.getCLDevices().length); + c.release(); + + c = CLContext.create(CLDevice.Type.ALL); + assertNotNull(c); + assertEquals(deviceCount, c.getCLDevices().length); + c.release(); + + c = CLContext.create(platform, firstDevice); + assertNotNull(c); + assertEquals(1, c.getCLDevices().length); + c.release(); + + c = CLContext.create(platform, CLDevice.Type.ALL); + assertNotNull(c); + assertEquals(deviceCount, c.getCLDevices().length); + c.release(); + + } + @Test public void vectorAddGMTest() throws IOException { -- cgit v1.2.3