summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLBuffer.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-03-16 18:05:06 +0100
committerMichael Bien <[email protected]>2010-03-16 18:05:06 +0100
commit919d8e9f992c07ab18ddd6d192d6747e8d7aa40b (patch)
tree8a92dc8adb52758e1f09f2e87632e6f3f6ac695f /src/com/mbien/opencl/CLBuffer.java
parent81b94f83cb76128c481d21134c3d462590db23d0 (diff)
even more utility methods and general awesomeness.
Diffstat (limited to 'src/com/mbien/opencl/CLBuffer.java')
-rw-r--r--src/com/mbien/opencl/CLBuffer.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/mbien/opencl/CLBuffer.java b/src/com/mbien/opencl/CLBuffer.java
index 1895018d..2137fb91 100644
--- a/src/com/mbien/opencl/CLBuffer.java
+++ b/src/com/mbien/opencl/CLBuffer.java
@@ -10,12 +10,12 @@ import static com.mbien.opencl.CLException.*;
*/
public class CLBuffer<B extends Buffer> extends CLMemory<B> {
- protected CLBuffer(CLContext context, long id) {
- super(context, id);
+ protected CLBuffer(CLContext context, long id, int flags) {
+ super(context, id, flags);
}
- protected CLBuffer(CLContext context, B directBuffer, long id) {
- super(context, directBuffer, id);
+ protected CLBuffer(CLContext context, B directBuffer, long id, int flags) {
+ super(context, directBuffer, id, flags);
}
@SuppressWarnings("unchecked")
@@ -31,7 +31,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
long id = cl.clCreateBuffer(context.ID, flags, size, null, result, 0);
checkForError(result[0], "can not create cl buffer");
- return new CLBuffer(context, id);
+ return new CLBuffer(context, id, flags);
}
static <B extends Buffer> CLBuffer<B> create(CLContext context, B directBuffer, int flags) {
@@ -49,12 +49,12 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
long id = cl.clCreateBuffer(context.ID, flags, sizeOfBufferElem(directBuffer)*directBuffer.capacity(), host_ptr, result, 0);
checkForError(result[0], "can not create cl buffer");
- return new CLBuffer<B>(context, directBuffer, id);
+ return new CLBuffer<B>(context, directBuffer, id, flags);
}
@Override
public <T extends Buffer> CLBuffer<T> cloneWith(T directBuffer) {
- return new CLBuffer<T>(context, directBuffer, ID);
+ return new CLBuffer<T>(context, directBuffer, ID, FLAGS);
}
}