diff options
author | Wade Walker <[email protected]> | 2014-03-08 16:17:36 -0600 |
---|---|---|
committer | Wade Walker <[email protected]> | 2014-03-08 16:17:36 -0600 |
commit | 7a7f87a1fc7419f758ba9b134764ae544fd6d566 (patch) | |
tree | b640a9e29883b46444d6f01334f8e8cacf1a8431 /test/com/jogamp/opencl/CLProgramTest.java | |
parent | 7ab26044167c84fc6386cc179e8a8736d8978c91 (diff) |
Fix crashes due to AMD driver bugs.
programBinariesTest() failure was due to AMD drivers crashing
in clCreateKernelsInProgram() when the program is not built yet,
instead of returning error code CL_INVALID_PROGRAM_EXECUTABLE as they
should.
lowLevelVectorAddTest() failure was apparently due to the AMD drivers
writing past the end of a direct byte buffer in such a way that it made
System.gc() crash when called during teardown (this crash didn't even
dump stack). Making the buffer larger solved the problem.
Diffstat (limited to 'test/com/jogamp/opencl/CLProgramTest.java')
-rw-r--r-- | test/com/jogamp/opencl/CLProgramTest.java | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java index 7fb7bc32..7a56a939 100644 --- a/test/com/jogamp/opencl/CLProgramTest.java +++ b/test/com/jogamp/opencl/CLProgramTest.java @@ -85,12 +85,16 @@ public class CLProgramTest extends UITestCase { CLContext context = CLContext.create(); CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl")); - try{ - program.createCLKernels(); - fail("expected exception but got none :("); - }catch(CLException ex) { - out.println("got expected exception: "+ex.getCLErrorString()); - assertEquals(ex.errorcode, CL.CL_INVALID_PROGRAM_EXECUTABLE); + // only test kernel creation error on unbuilt program if we're not on AMD -- as of + // 3/8/2014, AMD drivers segfault on this instead of returning CL_INVALID_PROGRAM_EXECUTABLE + if(!context.getPlatform().isVendorAMD()) { + try{ + program.createCLKernels(); + fail("expected exception but got none :("); + }catch(CLException ex) { + out.println("got expected exception: "+ex.getCLErrorString()); + assertEquals(ex.errorcode, CL.CL_INVALID_PROGRAM_EXECUTABLE); + } } out.println(program.getBuildStatus()); @@ -127,7 +131,7 @@ public class CLProgramTest extends UITestCase { CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl")) .build(ENABLE_MAD, WARNINGS_ARE_ERRORS); - // optain binaries + // obtain binaries Map<CLDevice, byte[]> binaries = program.getBinaries(); assertFalse(binaries.isEmpty()); @@ -177,11 +181,15 @@ public class CLProgramTest extends UITestCase { assertNotNull(program.getSource()); assertEquals(program.getSource().length(), 0); - try{ - Map<String, CLKernel> kernels = program.createCLKernels(); - fail("expected an exception from createCLKernels but got: "+kernels); - }catch(CLException ex) { - // expected, not build yet + // only test kernel creation error on unbuilt program if we're not on AMD -- as of + // 3/8/2014, AMD drivers segfault on this instead of returning CL_INVALID_PROGRAM_EXECUTABLE + if(!context.getPlatform().isVendorAMD()) { + try{ + Map<String, CLKernel> kernels = program.createCLKernels(); + fail("expected an exception from createCLKernels but got: "+kernels); + }catch(CLException ex) { + // expected, not built yet + } } out.println(program.getBuildStatus()); |