summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-10-23 00:21:58 +0200
committerMichael Bien <[email protected]>2009-10-23 00:21:58 +0200
commit054e5005d1429ba6ea4f9283eee2988ff54d1abb (patch)
tree163f7124f6dba109de965f3382f8b2613cf2068c /test
parent503845224a820c0b9ce9204aa6215519f6b93c36 (diff)
utility methods and refactoring.
Diffstat (limited to 'test')
-rw-r--r--test/com/mbien/opencl/HighLevelBindingTest.java16
-rw-r--r--test/com/mbien/opencl/LowLevelBindingTest.java2
2 files changed, 10 insertions, 8 deletions
diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java
index 8ae61b2a..a0a2c13d 100644
--- a/test/com/mbien/opencl/HighLevelBindingTest.java
+++ b/test/com/mbien/opencl/HighLevelBindingTest.java
@@ -1,6 +1,6 @@
package com.mbien.opencl;
-import com.mbien.opencl.CLBuffer.MEM;
+import com.mbien.opencl.CLBuffer.Mem;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Map;
@@ -35,6 +35,7 @@ public class HighLevelBindingTest {
out.println("platform info:");
out.println(" name: "+platform.getName());
+ out.println(" id: "+platform.ID);
out.println(" profile: "+platform.getProfile());
out.println(" version: "+platform.getVersion());
out.println(" vendor: "+platform.getVendor());
@@ -62,7 +63,8 @@ public class HighLevelBindingTest {
out.println(" - - - highLevelTest; global memory kernel - - - ");
- CLContext context = CLContext.create();
+// CLPlatform[] clPlatforms = CLPlatform.listCLPlatforms();
+ CLContext context = CLContext.create(/*clPlatforms[0]*/);
CLDevice[] contextDevices = context.getCLDevices();
@@ -104,9 +106,9 @@ public class HighLevelBindingTest {
fillBuffer(srcA, 23456);
fillBuffer(srcB, 46987);
- CLBuffer clBufferA = context.createBuffer(srcA, MEM.READ_ONLY);
- CLBuffer clBufferB = context.createBuffer(srcB, MEM.READ_ONLY);
- CLBuffer clBufferC = context.createBuffer(dest, MEM.WRITE_ONLY);
+ CLBuffer clBufferA = context.createBuffer(srcA, Mem.READ_ONLY);
+ CLBuffer clBufferB = context.createBuffer(srcB, Mem.READ_ONLY);
+ CLBuffer clBufferC = context.createBuffer(dest, Mem.WRITE_ONLY);
Map<String, CLKernel> kernels = program.getCLKernels();
for (CLKernel kernel : kernels.values()) {
@@ -169,8 +171,8 @@ public class HighLevelBindingTest {
CLContext context = CLContext.create();
// the CL.MEM_* flag is probably completly irrelevant in our case since we do not use a kernel in this test
- CLBuffer clBufferA = context.createBuffer(elements*SIZEOF_INT, MEM.READ_ONLY);
- CLBuffer clBufferB = context.createBuffer(elements*SIZEOF_INT, MEM.READ_ONLY);
+ CLBuffer clBufferA = context.createBuffer(elements*SIZEOF_INT, Mem.READ_ONLY);
+ CLBuffer clBufferB = context.createBuffer(elements*SIZEOF_INT, Mem.READ_ONLY);
// fill only first read buffer -> we will copy the payload to the second later.
fillBuffer(clBufferA.buffer, 12345);
diff --git a/test/com/mbien/opencl/LowLevelBindingTest.java b/test/com/mbien/opencl/LowLevelBindingTest.java
index a746f977..3776a349 100644
--- a/test/com/mbien/opencl/LowLevelBindingTest.java
+++ b/test/com/mbien/opencl/LowLevelBindingTest.java
@@ -137,7 +137,7 @@ public class LowLevelBindingTest {
int ret = CL.CL_SUCCESS;
int[] intArray = new int[1];
- long context = cl.clCreateContextFromType(null, 0, CL.CL_DEVICE_TYPE_ALL, null, null, null, 0);
+ long context = cl.clCreateContextFromType(null, CL.CL_DEVICE_TYPE_ALL, null, null, null);
out.println("context handle: "+context);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longArray, 0);