From 0874fa955c0401dba9f54816a9654bb4380abed8 Mon Sep 17 00:00:00 2001 From: Wade Walker Date: Sat, 8 Feb 2014 14:00:41 -0600 Subject: Fix unit test bugs on Mac OS X 64-bit. This commit fixes bugs 959 (local work size set incorrectly), 960 (concurrencyTest() throws ConcurrentModificationException) 963 (programBinariesTest() causes SIGSEGV) and 964 (builderTest() cases CL_INVALID_VALUE). After this commit, all JOCL tests should pass on 64-bit Mac OS X. --- src/com/jogamp/opencl/CLProgram.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/com/jogamp/opencl/CLProgram.java') diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java index 3919d374..9dd3db82 100644 --- a/src/com/jogamp/opencl/CLProgram.java +++ b/src/com/jogamp/opencl/CLProgram.java @@ -70,6 +70,8 @@ public class CLProgram extends CLObjectResource { private boolean executable; private boolean released; + /** Set if program created from binary, or else getting source can crash the driver on Macs. */ + private boolean noSource; private CLProgram(CLContext context, long id) { super(context, id); @@ -591,11 +593,21 @@ public class CLProgram extends CLObjectResource { return Status.valueOf(clStatus); } + /** + * Must set this if the program is created from binary so we know not to call getSource(), + * which can SIGSEGV on Macs if there is no source. + */ + public void setNoSource() { + noSource = true; + } + /** * Returns the source code of this program. Note: sources are not cached, * each call of this method calls into Open */ public String getSource() { + if(noSource) + return ""; // some drivers return IVE codes if the program haven't been built from source. try{ return getProgramInfoString(CL_PROGRAM_SOURCE); @@ -810,7 +822,7 @@ public class CLProgram extends CLObjectResource { public final static String UNSAFE_MATH = "-cl-unsafe-math-optimizations"; /** - * Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or ±∞. + * Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or plus/minus infinity. * This option may violate the OpenCL numerical compliance requirements defined in in section 7.4 for * single-precision floating-point, section 9.3.9 for double-precision floating-point, and edge case behavior in section 7.5. */ -- cgit v1.2.3