summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLCommandQueue.java
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 /src/com/jogamp/opencl/CLCommandQueue.java
parent3016f4fe04dcabdd82d2475a7c23d3b47e1c8766 (diff)
parent560d4b4958c2838a934fb2008357a7a85e61b546 (diff)
Fix merge w/ latest mbien/edge
Diffstat (limited to 'src/com/jogamp/opencl/CLCommandQueue.java')
-rw-r--r--src/com/jogamp/opencl/CLCommandQueue.java110
1 files changed, 55 insertions, 55 deletions
diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java
index b1644cf2..eedb0bd4 100644
--- a/src/com/jogamp/opencl/CLCommandQueue.java
+++ b/src/com/jogamp/opencl/CLCommandQueue.java
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
import com.jogamp.common.nio.CachedBufferFactory;
import com.jogamp.opencl.llb.gl.CLGL;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.gl.CLGLObject;
import com.jogamp.opencl.llb.CLCommandQueueBinding;
import java.nio.Buffer;
@@ -68,9 +68,9 @@ public class CLCommandQueue extends CLObjectResource {
* Those direct memory buffers are used to move data between the JVM and OpenCL.
*/
private final IntBuffer pbA;
- private final NativeSizeBuffer ibA;
- private final NativeSizeBuffer ibB;
- private final NativeSizeBuffer ibC;
+ private final PointerBuffer ibA;
+ private final PointerBuffer ibB;
+ private final PointerBuffer ibC;
private CLCommandQueue(CLContext context, long id, CLDevice device, long properties) {
super(context, id);
@@ -79,13 +79,13 @@ public class CLCommandQueue extends CLObjectResource {
this.properties = properties;
this.cl = context.getPlatform().getCommandQueueBinding();
- 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));
- this.ibB = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
- this.ibC = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
-
+
+ this.ibA = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+ this.ibB = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+ this.ibC = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+
this.pbA = factory.newDirectIntBuffer(1);
}
@@ -121,7 +121,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putWriteBuffer(CLBuffer<?> writeBuffer, boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -165,7 +165,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putReadBuffer(CLBuffer<?> readBuffer, boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -214,7 +214,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putCopyBuffer(CLBuffer<?> src, CLBuffer<?> dest, int srcOffset, int destOffset, long bytesToCopy, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -284,7 +284,7 @@ public class CLCommandQueue extends CLObjectResource {
long rowPitch, long slicePitch, long hostRowPitch, long hostSlicePitch,
boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -362,7 +362,7 @@ public class CLCommandQueue extends CLObjectResource {
long rowPitch, long slicePitch, long hostRowPitch, long hostSlicePitch,
boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -443,7 +443,7 @@ public class CLCommandQueue extends CLObjectResource {
long srcRowPitch, long srcSlicePitch, long destRowPitch, long destSlicePitch,
CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -511,7 +511,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putWriteImage(CLImage2d<?> writeImage, int inputRowPitch,
int originX, int originY, int rangeX, int rangeY, boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -573,7 +573,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putWriteImage(CLImage3d<?> writeImage, int inputRowPitch, int inputSlicePitch,
int originX, int originY, int originZ, int rangeX, int rangeY, int rangeZ, boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -634,7 +634,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putReadImage(CLImage2d<?> readImage, int inputRowPitch,
int originX, int originY, int rangeX, int rangeY, boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -696,7 +696,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putReadImage(CLImage3d<?> readImage, int inputRowPitch, int inputSlicePitch,
int originX, int originY, int originZ, int rangeX, int rangeY, int rangeZ, boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -760,7 +760,7 @@ public class CLCommandQueue extends CLObjectResource {
int dstOriginX, int dstOriginY,
int rangeX, int rangeY, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -829,7 +829,7 @@ public class CLCommandQueue extends CLObjectResource {
int dstOriginX, int dstOriginY, int dstOriginZ,
int rangeX, int rangeY, int rangeZ, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -893,7 +893,7 @@ public class CLCommandQueue extends CLObjectResource {
long srcOffset, int dstOriginX, int dstOriginY,
int rangeX, int rangeY, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -960,7 +960,7 @@ public class CLCommandQueue extends CLObjectResource {
long srcOffset, int dstOriginX, int dstOriginY, int dstOriginZ,
int rangeX, int rangeY, int rangeZ, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1024,7 +1024,7 @@ public class CLCommandQueue extends CLObjectResource {
int srcOriginX, int srcOriginY,
int rangeX, int rangeY, long dstOffset, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1091,7 +1091,7 @@ public class CLCommandQueue extends CLObjectResource {
int srcOriginX, int srcOriginY, int srcOriginZ,
int rangeX, int rangeY, int rangeZ, long dstOffset, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1149,7 +1149,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public ByteBuffer putMapBuffer(CLBuffer<?> buffer, CLMemory.Map flag, long offset, long length, boolean blockingMap, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1209,7 +1209,7 @@ public class CLCommandQueue extends CLObjectResource {
int offsetX, int offsetY,
int rangeX, int rangeY, boolean blockingMap, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1275,7 +1275,7 @@ public class CLCommandQueue extends CLObjectResource {
int offsetX, int offsetY, int offsetZ,
int rangeX, int rangeY, int rangeZ, boolean blockingMap, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1319,7 +1319,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putUnmapMemory(CLMemory<?> memory, Buffer mapped, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1357,8 +1357,8 @@ public class CLCommandQueue extends CLObjectResource {
if(blockingWait) {
list.waitForEvent(index);
- }else{
- NativeSizeBuffer ids = list.getEventBuffer(index);
+ } else {
+ PointerBuffer ids = list.getEventBuffer(index);
int ret = cl.clEnqueueWaitForEvents(ID, 1, ids);
if(ret != CL_SUCCESS) {
throw newException(ret, "can not "+ (blockingWait?"blocking": "") +" wait for event #" + index+ " in "+list);
@@ -1418,7 +1418,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putTask(CLKernel kernel, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1455,9 +1455,9 @@ public class CLCommandQueue extends CLObjectResource {
* Calls {@native clEnqueueNDRangeKernel}.
*/
public CLCommandQueue put1DRangeKernel(CLKernel kernel, long globalWorkOffset, long globalWorkSize, long localWorkSize, CLEventList condition, CLEventList events) {
- NativeSizeBuffer globWO = null;
- NativeSizeBuffer globWS = null;
- NativeSizeBuffer locWS = null;
+ PointerBuffer globWO = null;
+ PointerBuffer globWS = null;
+ PointerBuffer locWS = null;
if(globalWorkOffset != 0) {
globWO = copy2NIO(ibA, globalWorkOffset);
@@ -1506,9 +1506,9 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue put2DRangeKernel(CLKernel kernel, long globalWorkOffsetX, long globalWorkOffsetY,
long globalWorkSizeX, long globalWorkSizeY,
long localWorkSizeX, long localWorkSizeY, CLEventList condition, CLEventList events) {
- NativeSizeBuffer globalWorkOffset = null;
- NativeSizeBuffer globalWorkSize = null;
- NativeSizeBuffer localWorkSize = null;
+ PointerBuffer globalWorkOffset = null;
+ PointerBuffer globalWorkSize = null;
+ PointerBuffer localWorkSize = null;
if(globalWorkOffsetX != 0 || globalWorkOffsetY != 0) {
globalWorkOffset = copy2NIO(ibA, globalWorkOffsetX, globalWorkOffsetY);
@@ -1556,9 +1556,9 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue put3DRangeKernel(CLKernel kernel, long globalWorkOffsetX, long globalWorkOffsetY, long globalWorkOffsetZ,
long globalWorkSizeX, long globalWorkSizeY, long globalWorkSizeZ,
long localWorkSizeX, long localWorkSizeY, long localWorkSizeZ, CLEventList condition, CLEventList events) {
- NativeSizeBuffer globalWorkOffset = null;
- NativeSizeBuffer globalWorkSize = null;
- NativeSizeBuffer localWorkSize = null;
+ PointerBuffer globalWorkOffset = null;
+ PointerBuffer globalWorkSize = null;
+ PointerBuffer localWorkSize = null;
if(globalWorkOffsetX != 0 || globalWorkOffsetY != 0 || globalWorkOffsetZ != 0) {
globalWorkOffset = copy2NIO(ibA, globalWorkOffsetX, globalWorkOffsetY, globalWorkOffsetZ);
@@ -1576,7 +1576,7 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueNDRangeKernel}.
*/
- public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, NativeSizeBuffer globalWorkOffset, NativeSizeBuffer globalWorkSize, NativeSizeBuffer localWorkSize) {
+ public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset, PointerBuffer globalWorkSize, PointerBuffer localWorkSize) {
this.putNDRangeKernel(kernel, workDimension, globalWorkOffset, globalWorkSize, localWorkSize, null, null);
return this;
}
@@ -1584,7 +1584,7 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueNDRangeKernel}.
*/
- public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, NativeSizeBuffer globalWorkOffset, NativeSizeBuffer globalWorkSize, NativeSizeBuffer localWorkSize, CLEventList events) {
+ public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset, PointerBuffer globalWorkSize, PointerBuffer localWorkSize, CLEventList events) {
this.putNDRangeKernel(kernel, workDimension, globalWorkOffset, globalWorkSize, localWorkSize, null, events);
return this;
}
@@ -1592,10 +1592,10 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueNDRangeKernel}.
*/
- public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, NativeSizeBuffer globalWorkOffset,
- NativeSizeBuffer globalWorkSize, NativeSizeBuffer localWorkSize, CLEventList condition, CLEventList events) {
+ public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset,
+ PointerBuffer globalWorkSize, PointerBuffer localWorkSize, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1668,9 +1668,9 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueAcquireGLObjects}.
*/
- public CLCommandQueue putAcquireGLObjects(NativeSizeBuffer glObjectIDs, CLEventList condition, CLEventList events) {
+ public CLCommandQueue putAcquireGLObjects(PointerBuffer glObjectIDs, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1737,9 +1737,9 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueReleaseGLObjects}.
*/
- public CLCommandQueue putReleaseGLObjects(NativeSizeBuffer glObjectIDs, CLEventList condition, CLEventList events) {
+ public CLCommandQueue putReleaseGLObjects(PointerBuffer glObjectIDs, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1805,19 +1805,19 @@ public class CLCommandQueue extends CLObjectResource {
}
}
- private static NativeSizeBuffer copy2NIO(NativeSizeBuffer buffer, long a) {
+ private static PointerBuffer copy2NIO(PointerBuffer buffer, long a) {
return buffer.put(2, a).position(2);
}
- private static NativeSizeBuffer copy2NIO(NativeSizeBuffer buffer, long a, long b) {
+ private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b) {
return buffer.position(1).put(a).put(b).position(1);
}
- private static NativeSizeBuffer copy2NIO(NativeSizeBuffer buffer, long a, long b, long c) {
+ private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b, long c) {
return buffer.rewind().put(a).put(b).put(c).rewind();
}
- private static String toStr(NativeSizeBuffer buffer) {
+ private static String toStr(PointerBuffer buffer) {
if(buffer == null) {
return null;
}