summaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-05-31 19:51:46 +0200
committerMichael Bien <[email protected]>2010-05-31 19:51:46 +0200
commitc5b1dc47f398597a127ebb7cdf72ab324b08a174 (patch)
tree690599a569f5f5a78f190eff45e414b4574759fd /test/com/jogamp/opencl
parent8a5bbd80a3ffc3154b637e0b6c40342dfacb3576 (diff)
changes due to gluegen size_t fix. Switched back to PointerBuffer. 32bit systems are now supported again.
Diffstat (limited to 'test/com/jogamp/opencl')
-rw-r--r--test/com/jogamp/opencl/CLProgramTest.java12
-rw-r--r--test/com/jogamp/opencl/LowLevelBindingTest.java21
2 files changed, 16 insertions, 17 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java
index b25230f8..fd98e78e 100644
--- a/test/com/jogamp/opencl/CLProgramTest.java
+++ b/test/com/jogamp/opencl/CLProgramTest.java
@@ -189,7 +189,7 @@ public class CLProgramTest {
.withDefine("ENABLE_FOOBAR");
out.println(builder);
-
+
// async build test
{
final CountDownLatch countdown = new CountDownLatch(1);
@@ -233,7 +233,7 @@ public class CLProgramTest {
program = programConfig.build();
assertTrue(program.isExecutable());
-
+
// cloneing
assertEquals(builder, builder.clone());
@@ -277,5 +277,13 @@ public class CLProgramTest {
}
+// @Test
+ public void loadTest() throws IOException, ClassNotFoundException, InterruptedException {
+ for(int i = 0; i < 100; i++) {
+ rebuildProgramTest();
+ builderTest();
+ programBinariesTest();
+ }
+ }
}
diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java
index af72c46f..e7ffadba 100644
--- a/test/com/jogamp/opencl/LowLevelBindingTest.java
+++ b/test/com/jogamp/opencl/LowLevelBindingTest.java
@@ -2,7 +2,6 @@ package com.jogamp.opencl;
import java.util.Random;
import com.jogamp.opencl.impl.BuildProgramCallback;
-import com.jogamp.common.nio.Int64Buffer;
import com.jogamp.common.nio.PointerBuffer;
import java.nio.ByteBuffer;
@@ -87,7 +86,7 @@ public class LowLevelBindingTest {
checkForError(ret);
// print platform info
- Int64Buffer longBuffer = Int64Buffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ByteBuffer bb = newDirectByteBuffer(128);
for (int i = 0; i < platformId.capacity(); i++) {
@@ -167,7 +166,7 @@ public class LowLevelBindingTest {
checkError("on clCreateContext", intBuffer.get());
//get number of devices
- Int64Buffer longBuffer = Int64Buffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
@@ -186,15 +185,6 @@ public class LowLevelBindingTest {
out.println(" - - - lowLevelTest2; VectorAdd kernel - - - ");
-// CreateContextCallback cb = new CreateContextCallback() {
-// @Override
-// public void createContextCallback(String errinfo, ByteBuffer private_info, long cb, Object user_data) {
-// throw new RuntimeException("not yet implemented...");
-// }
-// };
-
- Int64Buffer longBuffer = Int64Buffer.allocateDirect(1);
-
CL cl = CLPlatform.getLowLevelCLInterface();
int ret = CL.CL_SUCCESS;
@@ -217,6 +207,7 @@ public class LowLevelBindingTest {
out.println("context handle: "+context);
checkError("on clCreateContextFromType", ret);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
@@ -260,7 +251,7 @@ public class LowLevelBindingTest {
// Create the program
- Int64Buffer lengths = (Int64Buffer)Int64Buffer.allocateDirect(1).put(programSource.length());
+ PointerBuffer lengths = (PointerBuffer)PointerBuffer.allocateDirect(1).put(programSource.length());
final long program = cl.clCreateProgramWithSource(context, 1, new String[] {programSource}, lengths, intBuffer);
out.println("program id: "+program);
checkError("on clCreateProgramWithSource", intBuffer.get(0));
@@ -347,8 +338,8 @@ public class LowLevelBindingTest {
checkError("on clEnqueueWriteBuffer", ret);
// Launch kernel
- Int64Buffer gWS = (Int64Buffer) Int64Buffer.allocateDirect(1).put(globalWorkSize).rewind();
- Int64Buffer lWS = (Int64Buffer) Int64Buffer.allocateDirect(1).put(localWorkSize).rewind();
+ PointerBuffer gWS = (PointerBuffer) PointerBuffer.allocateDirect(1).put(globalWorkSize).rewind();
+ PointerBuffer lWS = (PointerBuffer) PointerBuffer.allocateDirect(1).put(localWorkSize).rewind();
ret = cl.clEnqueueNDRangeKernel(commandQueue, kernel, 1, null, gWS, lWS, 0, null, null);
checkError("on clEnqueueNDRangeKernel", ret);