From c6f97a2e6ea1d337f371152a2fee65ee1dd4c5d5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 18 May 2011 04:00:45 +0200 Subject: Synced w/ mbien's JOCL branch - Making it compatible w/ GlueGen again --- test/com/jogamp/opencl/LowLevelBindingTest.java | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java index 9e60387..43e3b93 100644 --- a/test/com/jogamp/opencl/LowLevelBindingTest.java +++ b/test/com/jogamp/opencl/LowLevelBindingTest.java @@ -30,7 +30,7 @@ package com.jogamp.opencl; import java.util.Random; import com.jogamp.opencl.impl.BuildProgramCallback; -import com.jogamp.common.nio.NativeSizeBuffer; +import com.jogamp.common.nio.PointerBuffer; import java.nio.ByteBuffer; import java.nio.IntBuffer; @@ -109,12 +109,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++) { @@ -143,7 +143,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 @@ -176,7 +176,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); @@ -187,14 +187,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); @@ -223,19 +223,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); @@ -284,7 +284,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)); @@ -370,8 +370,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); @@ -463,4 +463,4 @@ public class LowLevelBindingTest { } -} \ No newline at end of file +} -- cgit v1.2.3