summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLMemory.java
diff options
context:
space:
mode:
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) {