diff options
-rw-r--r-- | src/com/jogamp/opencl/CLCommandQueue.java | 5 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CLEventList.java | 6 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CLMemory.java | 4 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CLProgram.java | 8 |
4 files changed, 11 insertions, 12 deletions
diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java index d578738b..cbdd59fa 100644 --- a/src/com/jogamp/opencl/CLCommandQueue.java +++ b/src/com/jogamp/opencl/CLCommandQueue.java @@ -76,7 +76,7 @@ public class CLCommandQueue extends CLObject implements CLResource { this.device = device; this.properties = properties; - int pbsize = NativeSizeBuffer.elementSize(); + int pbsize = PointerBuffer.ELEMENT_SIZE; CachedBufferFactory factory = CachedBufferFactory.create(9*pbsize + 4, true); this.ibA = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize)); @@ -1351,8 +1351,7 @@ public class CLCommandQueue extends CLObject implements CLResource { */ public CLCommandQueue putWaitForEvent(CLEventList list, int index, boolean blockingWait) { - NativeSizeBuffer ids = NativeSizeBuffer.wrap(list.IDs.getBuffer().duplicate()).position(index); - + PointerBuffer ids = list.IDs.duplicate().position(index); int ret = blockingWait ? cl.clWaitForEvents(1, ids) : cl.clEnqueueWaitForEvents(ID, 1, ids); if(ret != CL_SUCCESS) { diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java index 3642d915..fe6378b7 100644 --- a/src/com/jogamp/opencl/CLEventList.java +++ b/src/com/jogamp/opencl/CLEventList.java @@ -64,13 +64,13 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL public CLEventList(CachedBufferFactory factory, int capacity) { this.events = new CLEvent[capacity]; this.IDs = initIDBuffer(factory, capacity); - this.IDsView = NativeSizeBuffer.wrap(IDs.getBuffer().duplicate()); + this.IDsView = IDs.duplicate(); } public CLEventList(CachedBufferFactory factory, CLEvent... events) { this.events = events; this.IDs = initIDBuffer(factory, events.length); - this.IDsView = NativeSizeBuffer.wrap(IDs.getBuffer().duplicate()); + this.IDsView = IDs.duplicate(); for (CLEvent event : events) { if(event == null) { @@ -86,7 +86,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL if(factory == null) { return NativeSizeBuffer.allocateDirect(size); }else{ - return NativeSizeBuffer.wrap(factory.newDirectByteBuffer(size*NativeSizeBuffer.elementSize())); + return PointerBuffer.wrap(factory.newDirectByteBuffer(size*PointerBuffer.ELEMENT_SIZE)); } } diff --git a/src/com/jogamp/opencl/CLMemory.java b/src/com/jogamp/opencl/CLMemory.java index f299439d..db64f8a5 100644 --- a/src/com/jogamp/opencl/CLMemory.java +++ b/src/com/jogamp/opencl/CLMemory.java @@ -86,8 +86,8 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL } protected static long getSizeImpl(CL cl, long id) { - NativeSizeBuffer pb = NativeSizeBuffer.allocateDirect(1); - int ret = cl.clGetMemObjectInfo(id, CL_MEM_SIZE, NativeSizeBuffer.elementSize(), pb.getBuffer(), null); + PointerBuffer pb = PointerBuffer.allocateDirect(1); + int ret = cl.clGetMemObjectInfo(id, CL_MEM_SIZE, pb.elementSize(), pb.getBuffer(), null); checkForError(ret, "can not obtain buffer info"); return pb.get(); } diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java index e8706a73..54d8cc12 100644 --- a/src/com/jogamp/opencl/CLProgram.java +++ b/src/com/jogamp/opencl/CLProgram.java @@ -102,7 +102,7 @@ public class CLProgram extends CLObject implements CLResource { binarySize += entry.getValue().length; } - int pbSize = NativeSizeBuffer.elementSize(); + int pbSize = PointerBuffer.ELEMENT_SIZE; int deviceCount = binaries.size(); CachedBufferFactory bf = CachedBufferFactory.create(binarySize + pbSize*deviceCount*3 + 4, true); @@ -605,8 +605,8 @@ public class CLProgram extends CLObject implements CLResource { CLDevice[] devices = getCLDevices(); - NativeSizeBuffer sizes = NativeSizeBuffer.allocateDirect(devices.length); - int ret = cl.clGetProgramInfo(ID, CL_PROGRAM_BINARY_SIZES, sizes.capacity()*NativeSizeBuffer.elementSize(), sizes.getBuffer(), null); + PointerBuffer sizes = PointerBuffer.allocateDirect(devices.length); + int ret = cl.clGetProgramInfo(ID, CL_PROGRAM_BINARY_SIZES, sizes.capacity()*sizes.elementSize(), sizes.getBuffer(), null); if(ret != CL_SUCCESS) { throw newException(ret, "on clGetProgramInfo(CL_PROGRAM_BINARY_SIZES) of "+this); } @@ -628,7 +628,7 @@ public class CLProgram extends CLObject implements CLResource { } addresses.rewind(); - ret = cl.clGetProgramInfo(ID, CL_PROGRAM_BINARIES, addresses.capacity()*NativeSizeBuffer.elementSize(), addresses.getBuffer(), null); + ret = cl.clGetProgramInfo(ID, CL_PROGRAM_BINARIES, addresses.capacity()*addresses.elementSize(), addresses.getBuffer(), null); if(ret != CL_SUCCESS) { throw newException(ret, "on clGetProgramInfo(CL_PROGRAM_BINARIES) of "+this); } |