| 36 | } |
| 37 | |
| 38 | cl_int |
| 39 | waitForSuccessfulFinish( |
| 40 | cl_uint numCommandQueues, |
| 41 | cl_command_queue *commandQueues, |
| 42 | cl_event *events) |
| 43 | { |
| 44 | cl_int err = CL_SUCCESS; |
| 45 | cl_uint i; |
| 46 | |
| 47 | for (i = 0; i < numCommandQueues; i++) { |
| 48 | cl_int e; |
| 49 | cl_int status; |
| 50 | |
| 51 | e = clFinish(commandQueues[i]); |
| 52 | if ((events != NULL) && (events[i] != NULL)) { |
| 53 | if (e == CL_SUCCESS) { |
| 54 | status = CL_COMPLETE; |
| 55 | e = clGetEventInfo(events[i], CL_EVENT_COMMAND_EXECUTION_STATUS, |
| 56 | sizeof(status), &status, NULL); |
| 57 | if ((e == CL_SUCCESS) && (status < 0)) { |
| 58 | e = -status; |
| 59 | } |
| 60 | } |
| 61 | clReleaseEvent(events[i]); |
| 62 | } |
| 63 | |
| 64 | if (err == CL_SUCCESS) { |
| 65 | err = e; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return err; |
| 70 | } |
| 71 | |
| 72 | cl_int |
| 73 | flushAll( |
no outgoing calls
no test coverage detected