summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLMemory.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-03-01 02:13:49 +0100
committerMichael Bien <[email protected]>2010-03-01 02:13:49 +0100
commit63a97ef2af4e97ec077d48edd62c41dc2d17eb14 (patch)
treed17ccf52ad318717d7d2cf575bd2cce133190d82 /src/com/mbien/opencl/CLMemory.java
parenta0bc08e7f90733d291bd730a3fcde069602f99e8 (diff)
added put/setNullArg(int size) for setting NULL ranges as kernel argument to CLKernel.
added missing flush() to CLCommandQueue. added CLMemory.getCapacity() utility method.
Diffstat (limited to 'src/com/mbien/opencl/CLMemory.java')
-rw-r--r--src/com/mbien/opencl/CLMemory.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java
index 84aeb6b1..275f39ff 100644
--- a/src/com/mbien/opencl/CLMemory.java
+++ b/src/com/mbien/opencl/CLMemory.java
@@ -76,7 +76,17 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL
}
/**
- * Returns the size of the wrapped direct buffer in byte.
+ * Returns the capacity of the wrapped direct buffer or 0 if no buffer available.
+ */
+ public int getCapacity() {
+ if(buffer == null) {
+ return 0;
+ }
+ return buffer.capacity();
+ }
+
+ /**
+ * Returns the size of the wrapped direct buffer in byte or 0 if no buffer available.
*/
public int getSize() {
if(buffer == null) {