diff options
author | Sven Gothel <[email protected]> | 2011-05-18 04:00:45 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-05-18 04:00:45 +0200 |
commit | c6f97a2e6ea1d337f371152a2fee65ee1dd4c5d5 (patch) | |
tree | 352756b92e3a6f9541848dc4cb8f73a6268e59cf /src/com/jogamp/opencl/CLContext.java | |
parent | 773060662ef81707f70c447b71e664635ac45e2a (diff) |
Synced w/ mbien's JOCL branch - Making it compatible w/ GlueGen again
Diffstat (limited to 'src/com/jogamp/opencl/CLContext.java')
-rw-r--r-- | src/com/jogamp/opencl/CLContext.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/jogamp/opencl/CLContext.java b/src/com/jogamp/opencl/CLContext.java index 850f6c0e..c8a847a2 100644 --- a/src/com/jogamp/opencl/CLContext.java +++ b/src/com/jogamp/opencl/CLContext.java @@ -32,7 +32,7 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.opencl.CLDevice.Type; import com.jogamp.opencl.CLSampler.AddressingMode; import com.jogamp.opencl.CLSampler.FilteringMode; -import com.jogamp.common.nio.NativeSizeBuffer; +import com.jogamp.common.nio.PointerBuffer; import com.jogamp.opencl.impl.CLImageFormatImpl; import java.io.BufferedReader; import java.io.IOException; @@ -119,7 +119,7 @@ public class CLContext extends CLObject implements CLResource { if (devices == null) { - NativeSizeBuffer deviceCount = NativeSizeBuffer.allocateDirect(1); + PointerBuffer deviceCount = PointerBuffer.allocateDirect(1); int ret = cl.clGetContextInfo(ID, CL.CL_CONTEXT_DEVICES, 0, null, deviceCount); checkForError(ret, "can not enumerate devices"); @@ -170,7 +170,7 @@ public class CLContext extends CLObject implements CLResource { long type = toDeviceBitmap(deviceTypes); - NativeSizeBuffer properties = setupContextProperties(platform); + PointerBuffer properties = setupContextProperties(platform); ErrorDispatcher dispatcher = new ErrorDispatcher(); return new CLContext(platform, createContextFromType(dispatcher, properties, type), dispatcher); } @@ -188,7 +188,7 @@ public class CLContext extends CLObject implements CLResource { CLPlatform platform = devices[0].getPlatform(); - NativeSizeBuffer properties = setupContextProperties(platform); + PointerBuffer properties = setupContextProperties(platform); ErrorDispatcher dispatcher = new ErrorDispatcher(); CLContext context = new CLContext(platform, createContext(dispatcher, properties, devices), dispatcher); if(devices != null) { @@ -199,7 +199,7 @@ public class CLContext extends CLObject implements CLResource { return context; } - protected static long createContextFromType(CLErrorHandler handler, NativeSizeBuffer properties, long deviceType) { + protected static long createContextFromType(CLErrorHandler handler, PointerBuffer properties, long deviceType) { IntBuffer status = newDirectIntBuffer(1); long context = CLPlatform.getLowLevelCLInterface().clCreateContextFromType(properties, deviceType, handler, status); @@ -209,12 +209,12 @@ public class CLContext extends CLObject implements CLResource { return context; } - protected static long createContext(CLErrorHandler handler, NativeSizeBuffer properties, CLDevice... devices) { + protected static long createContext(CLErrorHandler handler, PointerBuffer properties, CLDevice... devices) { IntBuffer status = newDirectIntBuffer(1); - NativeSizeBuffer pb = null; + PointerBuffer pb = null; if(devices != null && devices.length != 0) { - pb = NativeSizeBuffer.allocateDirect(devices.length); + pb = PointerBuffer.allocateDirect(devices.length); for (int i = 0; i < devices.length; i++) { CLDevice device = devices[i]; if(device == null) { @@ -230,13 +230,13 @@ public class CLContext extends CLObject implements CLResource { return context; } - private static NativeSizeBuffer setupContextProperties(CLPlatform platform) { + private static PointerBuffer setupContextProperties(CLPlatform platform) { if(platform == null) { throw new RuntimeException("no OpenCL installation found"); } - return NativeSizeBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM) + return PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM) .put(platform.ID).put(0) // 0 terminated array .rewind(); } |