diff options
author | Michael Bien <[email protected]> | 2010-01-21 15:06:00 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-01-21 15:06:00 +0100 |
commit | 564b4d7e2fcd4c408ae6046710b29f3a12280574 (patch) | |
tree | 7d0a92eaf66034fd2f34e0a71c095fdd4190faba /src/com/mbien/opencl/CLMemory.java | |
parent | 96251f7aa2770d2d8278afbd6e4b603c24932049 (diff) |
moved all CLGL specific methods into CLGLBuffer.
Diffstat (limited to 'src/com/mbien/opencl/CLMemory.java')
-rw-r--r-- | src/com/mbien/opencl/CLMemory.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java index 86ad66d4..836987e6 100644 --- a/src/com/mbien/opencl/CLMemory.java +++ b/src/com/mbien/opencl/CLMemory.java @@ -1,6 +1,7 @@ package com.mbien.opencl; import com.sun.gluegen.runtime.BufferFactory; +import com.sun.gluegen.runtime.PointerBuffer; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.DoubleBuffer; @@ -85,6 +86,13 @@ public abstract class CLMemory <B extends Buffer> implements CLResource { return sizeOfBufferElem(buffer) * buffer.capacity(); } + public long getCLSize() { + PointerBuffer pb = PointerBuffer.allocateDirect(1); + int ret = cl.clGetMemObjectInfo(ID, CL.CL_MEM_SIZE, PointerBuffer.elementSize(), pb.getBuffer(), null); + checkForError(ret, "can not optain buffer info"); + return pb.get(); + } + public void release() { int ret = cl.clReleaseMemObject(ID); context.onMemoryReleased(this); |