summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWade Walker <[email protected]>2014-04-13 16:04:16 -0500
committerWade Walker <[email protected]>2014-04-13 16:04:16 -0500
commit73313eb44d89faab8d502d780acfb07888b41ad3 (patch)
treebfaa1d8f38f6d764364454aaf1f0e7b9cde35155 /test
parent65144f3de56b4fc47262399d0b3bcb0fa5f3feee (diff)
Fix direct buffer usage in lowLevelVectorAddTest
Increase buffer size and rewind before reuse in every possible place. This is to try to remove a couple of remaining failures on some platforms. The failure causes an abnormal JVM exit without a stack trace when System.gc() is called during teardown.
Diffstat (limited to 'test')
-rw-r--r--test/com/jogamp/opencl/LowLevelBindingTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java
index 52d74882..803fab91 100644
--- a/test/com/jogamp/opencl/LowLevelBindingTest.java
+++ b/test/com/jogamp/opencl/LowLevelBindingTest.java
@@ -259,7 +259,7 @@ public class LowLevelBindingTest extends UITestCase {
// Was originally 4096, but had to make this bigger or it would crash in UITestCase.oneTimeTearDown(){ System.gc() }
// without even dumping a stack when using AMD drivers. Presumably the drivers would write past the end
// of the block and mess up GC info somehow.
- ByteBuffer bb = newDirectByteBuffer(8192);
+ ByteBuffer bb = newDirectByteBuffer(32768);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, bb.capacity(), bb, null);
checkError("on clGetContextInfo", ret);
@@ -273,6 +273,7 @@ public class LowLevelBindingTest extends UITestCase {
offset *= (is32Bit() ? 4 : 8);
long device = is32Bit()?bb.getInt(offset):bb.getLong(offset);
+ bb.rewind();
ret = cl.clGetDeviceInfo(device, CL.CL_DEVICE_MAX_WORK_GROUP_SIZE, bb.capacity(), bb, null);
checkError("on clGetDeviceInfo", ret);
int maxWGS = bb.getInt();
@@ -358,11 +359,13 @@ public class LowLevelBindingTest extends UITestCase {
out.println("program source length (cl): "+longBuffer.get(0));
out.println("program source length (java): "+programSource.length());
+ bb.rewind();
ret = cl.clGetProgramInfo(program, CL.CL_PROGRAM_SOURCE, bb.capacity(), bb, null);
checkError("on clGetProgramInfo CL_PROGRAM_SOURCE", ret);
out.println("program source:\n" + clString2JavaString(bb, (int)longBuffer.get(0)));
// Check program status
+ bb.rewind();
ret = cl.clGetProgramBuildInfo(program, device, CL.CL_PROGRAM_BUILD_STATUS, bb.capacity(), bb, null);
checkError("on clGetProgramBuildInfo1", ret);