summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-03-08 16:23:28 +0100
committerMichael Bien <[email protected]>2010-03-08 16:23:28 +0100
commit5ad19147a76f80635dcae18693929edbf1da2cbf (patch)
tree929896eab7d454edcb2267d9287d619600868250 /test
parentc77d94f00de586f3ffa54312dd752650a6ff4d7b (diff)
moved utilities to util package.
several smaller improvements and doc fixes.
Diffstat (limited to 'test')
-rw-r--r--test/com/mbien/opencl/CLCommandQueueTest.java13
-rw-r--r--test/com/mbien/opencl/CLProgramTest.java2
-rw-r--r--test/com/mbien/opencl/LowLevelBindingTest.java13
3 files changed, 18 insertions, 10 deletions
diff --git a/test/com/mbien/opencl/CLCommandQueueTest.java b/test/com/mbien/opencl/CLCommandQueueTest.java
index 9b502263..66757348 100644
--- a/test/com/mbien/opencl/CLCommandQueueTest.java
+++ b/test/com/mbien/opencl/CLCommandQueueTest.java
@@ -1,5 +1,6 @@
package com.mbien.opencl;
+import com.mbien.opencl.util.MultiQueueBarrier;
import com.mbien.opencl.CLCommandQueue.Mode;
import com.mbien.opencl.CLMemory.Mem;
import java.io.IOException;
@@ -191,6 +192,8 @@ public class CLCommandQueueTest {
final CLCommandQueue queue1 = devices[0 ].createCommandQueue();
final CLCommandQueue queue2 = devices[secondDevice].createCommandQueue();
+ fillBuffer(clBufferC.buffer, 12345);
+
if (secondDevice > 0) {
System.out.println("using two devices");
}
@@ -206,8 +209,8 @@ public class CLCommandQueueTest {
fillBuffer(clBufferB1.buffer, 67890);
// System.out.println("C buffer");
- queue1.putWriteBuffer(clBufferA1, false) // write A
- .putWriteBuffer(clBufferB1, true); // write B
+ queue1.putWriteBuffer(clBufferA1, false) // write A
+ .putWriteBuffer(clBufferB1, false); // write B
// System.out.println("C args");
vectorAddKernel1.setArgs(clBufferA1, clBufferB1, clBufferC); // C = A+B
@@ -231,15 +234,15 @@ public class CLCommandQueueTest {
fillBuffer(clBufferB2.buffer, 67890);
// System.out.println("D buffer");
- queue2.putWriteBuffer(clBufferA2, false) // write A
- .putWriteBuffer(clBufferB2, true); // write B
+ queue2.putWriteBuffer(clBufferA2, false) // write A
+ .putWriteBuffer(clBufferB2, false); // write B
// System.out.println("D args");
vectorAddKernel2.setArgs(clBufferA2, clBufferB2, clBufferD); // D = A+B
// System.out.println("D kernels");
CLEventList events2 = new CLEventList(2);
- queue2.put1DRangeKernel(vectorAddKernel2, 0, elements, 256, events2)
+ queue2.put1DRangeKernel(vectorAddKernel2, 0, elements, groupSize, events2)
.putReadBuffer(clBufferD, false, events2);
barrier.waitFor(queue2, events2);
diff --git a/test/com/mbien/opencl/CLProgramTest.java b/test/com/mbien/opencl/CLProgramTest.java
index 647ba1cb..f46933c6 100644
--- a/test/com/mbien/opencl/CLProgramTest.java
+++ b/test/com/mbien/opencl/CLProgramTest.java
@@ -1,5 +1,7 @@
package com.mbien.opencl;
+import com.mbien.opencl.util.CLBuildConfiguration;
+import com.mbien.opencl.util.CLProgramConfiguration;
import com.mbien.opencl.CLProgram.Status;
import java.io.File;
import java.io.FileInputStream;
diff --git a/test/com/mbien/opencl/LowLevelBindingTest.java b/test/com/mbien/opencl/LowLevelBindingTest.java
index 78ca3555..935ba73c 100644
--- a/test/com/mbien/opencl/LowLevelBindingTest.java
+++ b/test/com/mbien/opencl/LowLevelBindingTest.java
@@ -12,7 +12,7 @@ import org.junit.Test;
import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.mbien.opencl.TestUtils.*;
-import static com.mbien.opencl.CLUtils.*;
+import static com.mbien.opencl.util.CLUtil.*;
import static com.sun.gluegen.runtime.BufferFactory.*;
/**
@@ -52,13 +52,16 @@ public class LowLevelBindingTest {
@Test
public void contextlessTest() {
- System.out.println("low level tests temporary disabled");
-/*
+ out.println("low level tests temporary disabled");
out.println(" - - - lowLevelTest; contextless binding - - - ");
- int ret = CL.CL_SUCCESS;
- CL cl = CLPlatform.getLowLevelBinding();
+ CL cl = CLPlatform.getLowLevelCLInterface();
+
+ System.out.println(((CLImpl)cl).clGetExtensionFunctionAddress("clCreateFromGLBuffer").getLong());
+ System.out.println(((CLImpl)cl).clGetExtensionFunctionAddress("clEnqueueAcquireGLObjects").getLong());
+/*
+ int ret = CL.CL_SUCCESS;
int[] intBuffer = new int[1];
// find all available OpenCL platforms