summaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-06-28 22:32:22 +0200
committerSven Gothel <[email protected]>2011-06-28 22:32:22 +0200
commit20a94528161909e12fdcbd06cf5affe89a37efb9 (patch)
treed4084b90238b1a318e308039f2492092cad438e6 /test/com/jogamp/opencl
parent3016f4fe04dcabdd82d2475a7c23d3b47e1c8766 (diff)
parent560d4b4958c2838a934fb2008357a7a85e61b546 (diff)
Fix merge w/ latest mbien/edge
Diffstat (limited to 'test/com/jogamp/opencl')
-rw-r--r--test/com/jogamp/opencl/LowLevelBindingTest.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java
index 655bfc64..c8e27a60 100644
--- a/test/com/jogamp/opencl/LowLevelBindingTest.java
+++ b/test/com/jogamp/opencl/LowLevelBindingTest.java
@@ -29,8 +29,8 @@
package com.jogamp.opencl;
import java.util.Random;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.impl.BuildProgramCallback;
-import com.jogamp.common.nio.NativeSizeBuffer;
import com.jogamp.opencl.llb.CL;
import java.nio.ByteBuffer;
@@ -110,12 +110,12 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#platforms: "+intBuffer.get(0));
- NativeSizeBuffer platformId = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer platformId = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetPlatformIDs(platformId.capacity(), platformId, null);
checkForError(ret);
// print platform info
- NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ByteBuffer bb = newDirectByteBuffer(128);
for (int i = 0; i < platformId.capacity(); i++) {
@@ -144,7 +144,7 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#devices: "+intBuffer.get(0));
- NativeSizeBuffer devices = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer devices = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetDeviceIDs(platform, CL.CL_DEVICE_TYPE_ALL, devices.capacity(), devices, null);
//print device info
@@ -177,7 +177,7 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#platforms: "+intBuffer.get(0));
- NativeSizeBuffer pb = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer pb = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetPlatformIDs(pb.capacity(), pb, null);
checkForError(ret);
@@ -188,14 +188,14 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#devices: "+intBuffer.get(0));
- NativeSizeBuffer devices = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer devices = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetDeviceIDs(platform, CL.CL_DEVICE_TYPE_ALL, devices.capacity(), devices, null);
long context = cl.clCreateContext(null, devices, null, intBuffer);
checkError("on clCreateContext", intBuffer.get());
//get number of devices
- NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
@@ -224,19 +224,19 @@ public class LowLevelBindingTest {
checkForError(ret);
assertTrue(intBuffer.get(0) > 0);
- NativeSizeBuffer pb = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer pb = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetPlatformIDs(pb.capacity(), pb, null);
checkForError(ret);
long platform = pb.get(0);
- NativeSizeBuffer properties = NativeSizeBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM)
+ PointerBuffer properties = PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM)
.put(platform).put(0) // 0 terminated array
.rewind();
long context = cl.clCreateContextFromType(properties, CL.CL_DEVICE_TYPE_ALL, null, null);
out.println("context handle: "+context);
checkError("on clCreateContextFromType", ret);
- NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
@@ -285,7 +285,7 @@ public class LowLevelBindingTest {
// Create the program
- NativeSizeBuffer lengths = NativeSizeBuffer.allocateDirect(1).put(programSource.length()).rewind();
+ PointerBuffer lengths = PointerBuffer.allocateDirect(1).put(programSource.length()).rewind();
final long program = cl.clCreateProgramWithSource(context, 1, new String[] {programSource}, lengths, intBuffer);
out.println("program id: "+program);
checkError("on clCreateProgramWithSource", intBuffer.get(0));
@@ -372,8 +372,8 @@ public class LowLevelBindingTest {
checkError("on clEnqueueWriteBuffer", ret);
// Launch kernel
- NativeSizeBuffer gWS = NativeSizeBuffer.allocateDirect(1).put(globalWorkSize).rewind();
- NativeSizeBuffer lWS = NativeSizeBuffer.allocateDirect(1).put(localWorkSize).rewind();
+ PointerBuffer gWS = PointerBuffer.allocateDirect(1).put(globalWorkSize).rewind();
+ PointerBuffer lWS = PointerBuffer.allocateDirect(1).put(localWorkSize).rewind();
ret = cl.clEnqueueNDRangeKernel(commandQueue, kernel, 1, null, gWS, lWS, 0, null, null);
checkError("on clEnqueueNDRangeKernel", ret);
@@ -466,4 +466,4 @@ public class LowLevelBindingTest {
}
-} \ No newline at end of file
+}