From 91938387529fe220323e0c7472f788c78e1ace72 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Wed, 15 Sep 2010 18:33:21 +0200 Subject: removed CLContext factory methods with CLPlatform + CLDevice list combinations. justification: - information is now no longer needed since every CLDevice knows its CLPlatform - OpenCL device IDs are not portable between CLPlatforms changes: - Context factories will throw CLInvalidPlatformException if the platform of all CLDevices does not match related changes: - [persistance] CLProgramBuilder stores now the ICD suffix to be later able to map binaries back to the platform + device --- test/com/jogamp/opencl/HighLevelBindingTest.java | 25 ++++++++---------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'test/com') diff --git a/test/com/jogamp/opencl/HighLevelBindingTest.java b/test/com/jogamp/opencl/HighLevelBindingTest.java index e927f1fa..3755221b 100644 --- a/test/com/jogamp/opencl/HighLevelBindingTest.java +++ b/test/com/jogamp/opencl/HighLevelBindingTest.java @@ -169,8 +169,8 @@ public class HighLevelBindingTest { out.println(" - - - highLevelTest; create context - - - "); CLPlatform platform = CLPlatform.getDefault(); - int deviceCount = platform.listCLDevices().length; - CLDevice firstDevice = platform.listCLDevices()[0]; + CLDevice[] devices = platform.listCLDevices(); + int deviceCount = devices.length; CLContext c = CLContext.create(); assertNotNull(c); @@ -182,21 +182,18 @@ public class HighLevelBindingTest { assertEquals(deviceCount, c.getDevices().length); c.release(); - c = CLContext.create(firstDevice); - assertNotNull(c); - assertEquals(1, c.getDevices().length); - c.release(); + for (CLDevice device : devices) { + c = CLContext.create(device); + assertNotNull(c); + assertEquals(1, c.getDevices().length); + c.release(); + } c = CLContext.create(CLDevice.Type.ALL); assertNotNull(c); assertEquals(deviceCount, c.getDevices().length); c.release(); - c = CLContext.create(platform, firstDevice); - assertNotNull(c); - assertEquals(1, c.getDevices().length); - c.release(); - c = CLContext.create(platform, CLDevice.Type.ALL); assertNotNull(c); assertEquals(deviceCount, c.getDevices().length); @@ -216,12 +213,6 @@ public class HighLevelBindingTest { }catch(IllegalArgumentException ex) { // expected } - try{ - CLContext.create((CLPlatform)null, (CLDevice)null); - fail("create with null device"); - }catch(IllegalArgumentException ex) { - // expected - } try{ CLContext.create((CLPlatform)null, (CLDevice.Type)null); fail("create with null CLDevice.Type"); -- cgit v1.2.3