diff options
author | Michael Bien <[email protected]> | 2010-02-22 23:38:56 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-02-22 23:38:56 +0100 |
commit | d78faf0ef678cc87f5220d2cb8eccbe173449541 (patch) | |
tree | 8a4dcff14f70c88869d6bdc095817474ae729311 /src/com/mbien/opencl/CLMemory.java | |
parent | 7c83da1d2e3e8d122e562408a63a13928cc97c83 (diff) |
introduced CLObject as common superclass for all OpenCL objects.
Diffstat (limited to 'src/com/mbien/opencl/CLMemory.java')
-rw-r--r-- | src/com/mbien/opencl/CLMemory.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java index 884744ad..59537f85 100644 --- a/src/com/mbien/opencl/CLMemory.java +++ b/src/com/mbien/opencl/CLMemory.java @@ -16,26 +16,17 @@ import static com.mbien.opencl.CL.*; * * @author Michael Bien */ -public abstract class CLMemory <B extends Buffer> implements CLResource { +public abstract class CLMemory <B extends Buffer> extends CLObject implements CLResource { B buffer; - public final long ID; - - protected final CLContext context; - protected final CL cl; - protected <Buffer> CLMemory(CLContext context, long id) { - this.context = context; - this.cl = context.cl; - this.ID = id; + super(context, id); } protected CLMemory(CLContext context, B directBuffer, long id) { + super(context, id); this.buffer = directBuffer; - this.context = context; - this.cl = context.cl; - this.ID = id; } /** @@ -77,6 +68,9 @@ public abstract class CLMemory <B extends Buffer> implements CLResource { return this; } + /** + * Returns the optional NIO buffer for this memory object. + */ public B getBuffer() { return buffer; } |