@@ -286,16 +286,25 @@ void pocl_update_event_complete (const char *func, unsigned line,
286286 cl_event event , const char * msg );
287287
288288/**
289- * Should be called by a driver when the event execution fails for some reason
289+ * Mark the event as failed with the status and do all the required
290+ * cleanup work (releasing memory, notifying others waiting on the event, etc).
290291 *
291- * Sets the event status to failure (CL_FAILED) and does all the required
292- * cleanup work (releasing memory, notifying others waiting on the event, etc)
292+ * \warning Call with event unlocked.
293+ * \warning Eventually clReleaseEvent is called, so this function can end up
294+ * freeing the event.
295+ * \param status [in] Status to be set for the event. Should be an error status
296+ * like CL_FAILED or CL_DEVICE_NOT_AVAILABLE.
297+ * \param func [in] Can be NULL, the function name calling this function.
298+ * \param line [in] Can be 0, the line number which failed.
299+ * \param event [in/out] Event to be marked as failed.
300+ * \param msg [in] Can be NULL, informative error message.
293301 */
294- POCL_EXPORT
295- void pocl_update_event_failed (const char * func ,
296- unsigned line ,
297- cl_event event ,
298- const char * msg );
302+ POCL_EXPORT void
303+ pocl_update_event_failed (cl_int status ,
304+ const char * func ,
305+ unsigned line ,
306+ cl_event event ,
307+ const char * msg );
299308
300309/**
301310 * Same as pocl_update_event_failed, except assumes the event is locked.
@@ -313,11 +322,11 @@ void pocl_update_event_device_lost (cl_event event);
313322#define POCL_UPDATE_EVENT_COMPLETE (__event ) \
314323 pocl_update_event_complete (__func__, __LINE__, (__event), NULL)
315324
316- #define POCL_UPDATE_EVENT_FAILED (__event ) \
317- pocl_update_event_failed (__func__, __LINE__, (__event), NULL)
325+ #define POCL_UPDATE_EVENT_FAILED (status , __event ) \
326+ pocl_update_event_failed ((status), __func__, __LINE__, (__event), NULL)
318327
319- #define POCL_UPDATE_EVENT_FAILED_MSG (__event , msg ) \
320- pocl_update_event_failed (__func__, __LINE__, (__event), msg)
328+ #define POCL_UPDATE_EVENT_FAILED_MSG (status , __event , msg ) \
329+ pocl_update_event_failed ((status), __func__, __LINE__, (__event), msg)
321330
322331POCL_EXPORT
323332int pocl_copy_command_node (_cl_command_node * dst_node ,
0 commit comments