diff options
author | Wade Walker <[email protected]> | 2014-02-08 14:00:41 -0600 |
---|---|---|
committer | Wade Walker <[email protected]> | 2014-02-08 14:00:41 -0600 |
commit | 0874fa955c0401dba9f54816a9654bb4380abed8 (patch) | |
tree | 6495ec3de88f7fafe7d49bcfbf62c9915ff045bf /src/com/jogamp/opencl/CLContext.java | |
parent | 10f9ddfad21c8ab1d4287742d1b524ae11e916c8 (diff) |
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.
Diffstat (limited to 'src/com/jogamp/opencl/CLContext.java')
-rw-r--r-- | src/com/jogamp/opencl/CLContext.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/com/jogamp/opencl/CLContext.java b/src/com/jogamp/opencl/CLContext.java index c3bd0e3f..163375eb 100644 --- a/src/com/jogamp/opencl/CLContext.java +++ b/src/com/jogamp/opencl/CLContext.java @@ -287,6 +287,7 @@ public class CLContext extends CLObjectResource { */ public CLProgram createProgram(Map<CLDevice, byte[]> binaries) { CLProgram program = CLProgram.create(this, binaries); + program.setNoSource(); programs.add(program); return program; } @@ -486,11 +487,8 @@ public class CLContext extends CLObjectResource { private void release(Collection<? extends CLResource> resources) { // resources remove themselves when released, see above - if(!resources.isEmpty()) { - CLResource[] array = resources.toArray(new CLResource[resources.size()]); - for (CLResource resource : array) { - resource.release(); - } + while(!resources.isEmpty()) { + resources.iterator().next().release(); } } @@ -509,9 +507,8 @@ public class CLContext extends CLObjectResource { synchronized(queuesMap) { final Collection<List<CLCommandQueue>> queuesList = queuesMap.values(); - for( Iterator<List<CLCommandQueue>> queuesI = queuesList.iterator(); queuesI.hasNext(); ) { - release(queuesI.next()); - } + while(!queuesList.isEmpty()) + release(queuesList.iterator().next()); } } finally { |