diff options
author | Michael Bien <[email protected]> | 2010-02-18 01:40:40 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-02-18 01:40:40 +0100 |
commit | 074e8a18e8f5f77168bde267ab87f3cf285f82be (patch) | |
tree | 5dfd0063968fc2ed1b809b86daa247f8cda27fcd /src/com/mbien/opencl/CLContext.java | |
parent | 62d9a63caad9d614a4a4ca90956b38ff623242a5 (diff) |
added putCopyBufferToImage, putCopyImageToBuffer and putMap/UnmapBuffer operations to CLCommandQueue.
added buffer mapping test to CLBufferTest.
Diffstat (limited to 'src/com/mbien/opencl/CLContext.java')
-rw-r--r-- | src/com/mbien/opencl/CLContext.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLContext.java b/src/com/mbien/opencl/CLContext.java index 99322035..f92213fc 100644 --- a/src/com/mbien/opencl/CLContext.java +++ b/src/com/mbien/opencl/CLContext.java @@ -278,6 +278,22 @@ public class CLContext implements CLResource { /** * Creates a CLBuffer with the specified flags. No flags creates a MEM.READ_WRITE buffer. */ + public final CLBuffer<?> createBuffer(int size, Mem... flags) { + return createBuffer(size, Mem.flagsToInt(flags)); + } + + /** + * Creates a CLBuffer with the specified flags. + */ + public final CLBuffer<?> createBuffer(int size, int flags) { + CLBuffer<?> buffer = CLBuffer.create(this, size, flags); + memoryObjects.add(buffer); + return buffer; + } + + /** + * Creates a CLBuffer with the specified flags. No flags creates a MEM.READ_WRITE buffer. + */ public final <B extends Buffer> CLBuffer<B> createBuffer(B directBuffer, Mem... flags) { return createBuffer(directBuffer, Mem.flagsToInt(flags)); } |