summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/mbien/opencl/CLEvent.java')
-rw-r--r--src/com/mbien/opencl/CLEvent.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/com/mbien/opencl/CLEvent.java b/src/com/mbien/opencl/CLEvent.java
index c4b62917..45117bc6 100644
--- a/src/com/mbien/opencl/CLEvent.java
+++ b/src/com/mbien/opencl/CLEvent.java
@@ -17,7 +17,7 @@ public class CLEvent implements CLResource {
private final CLEventInfoAccessor eventInfo;
- CLEvent(CLContext context, int id) {
+ CLEvent(CLContext context, long id) {
this.context = context;
this.cl = context.cl;
this.ID = id;
@@ -38,6 +38,41 @@ public class CLEvent implements CLResource {
return CommandType.valueOf(status);
}
+ @Override
+ public String toString() {
+ return "CLEvent [id: " + ID
+ + " name: " + getType()
+ + " status: " + getStatus()+"]";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final CLEvent other = (CLEvent) obj;
+ if (this.context != other.context && (this.context == null || !this.context.equals(other.context))) {
+ return false;
+ }
+ if (this.ID != other.ID) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 5;
+ hash = 13 * hash + (this.context != null ? this.context.hashCode() : 0);
+ hash = 13 * hash + (int) (this.ID ^ (this.ID >>> 32));
+ return hash;
+ }
+
+
+
private class CLEventInfoAccessor extends CLInfoAccessor {
@Override