From 59148a192446ddfefb13516d7ada72e6fa1661c7 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sat, 1 May 2010 21:18:04 +0200 Subject: fixed CLProgramTest on AMD platform + GPU device. --- test/com/jogamp/opencl/CLProgramTest.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'test/com') diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java index e6ce9207..35dbde4b 100644 --- a/test/com/jogamp/opencl/CLProgramTest.java +++ b/test/com/jogamp/opencl/CLProgramTest.java @@ -226,9 +226,16 @@ public class CLProgramTest { @Test public void kernelTest() { - String source = "__attribute__((reqd_work_group_size(512, 512, 512))) kernel void foo(void) { }\n"; + String source = "__attribute__((reqd_work_group_size(256, 256, 256))) kernel void foo(void) { }\n"; - CLContext context = CLContext.create(); + // to workaround "Internal error: Link failed." on AMD platform + GPU device + final CLPlatform platform = CLPlatform.getDefault(); + CLDevice.Type type = CLDevice.Type.DEFAULT; + if(platform.getVendor().toLowerCase().contains("amd")) { + type = CLDevice.Type.CPU; + } + + CLContext context = CLContext.create(platform, type); try{ CLProgram program = context.createProgram(source).build(); @@ -241,9 +248,9 @@ public class CLProgramTest { out.println("compile workgroup size: " + wgs[0]+" "+wgs[1]+" "+wgs[2]); - assertEquals(512, wgs[0]); - assertEquals(512, wgs[1]); - assertEquals(512, wgs[2]); + assertEquals(256, wgs[0]); + assertEquals(256, wgs[1]); + assertEquals(256, wgs[2]); }finally{ -- cgit v1.2.3