aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLBuffer.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-10-19 23:02:09 +0200
committerMichael Bien <[email protected]>2009-10-19 23:02:09 +0200
commit224985638b2a1486e4b7da1642a4f2cc22fc8644 (patch)
tree2540189dc43f6d6b67001cab1e7d1332ffa14dc3 /src/com/mbien/opencl/CLBuffer.java
parentcb7fa23952a10795215eda50848530828b92895e (diff)
initial import of CLCommandQueue.
updated JUnit test to test CLCommandQueue. cleand up project dependencies.
Diffstat (limited to 'src/com/mbien/opencl/CLBuffer.java')
-rw-r--r--src/com/mbien/opencl/CLBuffer.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/com/mbien/opencl/CLBuffer.java b/src/com/mbien/opencl/CLBuffer.java
index 0f6e34a4..74df71e6 100644
--- a/src/com/mbien/opencl/CLBuffer.java
+++ b/src/com/mbien/opencl/CLBuffer.java
@@ -10,7 +10,7 @@ import static com.mbien.opencl.CLException.*;
public class CLBuffer {
public final ByteBuffer buffer;
- public final long bufferID;
+ public final long ID;
private final CLContext context;
private final CL cl;
@@ -26,16 +26,15 @@ public class CLBuffer {
int[] intArray = new int[1];
- this.bufferID = cl.clCreateBuffer(context.contextID, flags, directBuffer.capacity(), null, intArray, 0);
+ this.ID = cl.clCreateBuffer(context.ID, flags, directBuffer.capacity(), null, intArray, 0);
checkForError(intArray[0], "can not create cl buffer");
}
- public CLBuffer release() {
- cl.clReleaseMemObject(bufferID);
+ public void release() {
+ cl.clReleaseMemObject(ID);
context.bufferReleased(this);
- return this;
}
@Override
@@ -50,7 +49,7 @@ public class CLBuffer {
if (this.buffer != other.buffer && (this.buffer == null || !this.buffer.equals(other.buffer))) {
return false;
}
- if (this.context.contextID != other.context.contextID) {
+ if (this.context.ID != other.context.ID) {
return false;
}
return true;
@@ -60,7 +59,7 @@ public class CLBuffer {
public int hashCode() {
int hash = 3;
hash = 29 * hash + (this.buffer != null ? this.buffer.hashCode() : 0);
- hash = 29 * hash + (int) (this.context.contextID ^ (this.context.contextID >>> 32));
+ hash = 29 * hash + (int) (this.context.ID ^ (this.context.ID >>> 32));
return hash;
}