aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-02-19 22:21:34 +0100
committerMichael Bien <[email protected]>2010-02-19 22:21:34 +0100
commit8aed6c7f84eea5403422ded1cbb9b90073463d70 (patch)
treece7ab2fb40ad63d2af75a8297a52e227b2317748 /src/com
parented40efbf71daaee371d7eb334b0b7a00919548bc (diff)
added ERROR status to CLEvent.
Diffstat (limited to 'src/com')
-rw-r--r--src/com/mbien/opencl/CLEvent.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/mbien/opencl/CLEvent.java b/src/com/mbien/opencl/CLEvent.java
index 1855fea9..5d244190 100644
--- a/src/com/mbien/opencl/CLEvent.java
+++ b/src/com/mbien/opencl/CLEvent.java
@@ -37,9 +37,15 @@ public class CLEvent implements CLResource {
checkForError(ret, "can not release event");
}
+ /**
+ * Returns the execution status of the command which triggers this event.
+ */
public ExecutionStatus getStatus() {
- int status = (int)eventInfo.getLong(CL_EVENT_COMMAND_EXECUTION_STATUS);
- return ExecutionStatus.valueOf(status);
+ return ExecutionStatus.valueOf(getStatusCode());
+ }
+
+ public int getStatusCode() {
+ return (int)eventInfo.getLong(CL_EVENT_COMMAND_EXECUTION_STATUS);
}
public CommandType getType() {
@@ -182,7 +188,12 @@ public class CLEvent implements CLResource {
/**
* The command has completed.
*/
- COMPLETE(CL_COMPLETE);
+ COMPLETE(CL_COMPLETE),
+
+ /**
+ * The command did not complete because of an error.
+ */
+ ERROR(-1);
/**
@@ -205,6 +216,9 @@ public class CLEvent implements CLResource {
case(CL_COMPLETE):
return COMPLETE;
}
+ if(status < 0) {
+ return ERROR;
+ }
return null;
}
}