@@ -1300,13 +1300,14 @@ ur_result_t waitForDependencies(ur_exp_command_buffer_handle_t CommandBuffer,
1300
1300
* @param[in] CommandBuffer The command buffer.
1301
1301
* @param[in] Queue The UR queue used to submit the command buffer.
1302
1302
* @param[in] SignalCommandList The command-list to append the barrier to.
1303
- * @param[out] Event The host visible event which will be returned to the user.
1303
+ * @param[out][optional] Event The host visible event which will be returned
1304
+ * to the user, if user passed an output parameter to the UR API.
1304
1305
* @return UR_RESULT_SUCCESS or an error code on failure
1305
1306
*/
1306
1307
ur_result_t createUserEvent (ur_exp_command_buffer_handle_t CommandBuffer,
1307
1308
ur_queue_handle_legacy_t Queue,
1308
1309
ur_command_list_ptr_t SignalCommandList,
1309
- ur_event_handle_t & Event) {
1310
+ ur_event_handle_t * Event) {
1310
1311
// Execution event for this enqueue of the UR command-buffer
1311
1312
ur_event_handle_t RetEvent{};
1312
1313
@@ -1342,7 +1343,9 @@ ur_result_t createUserEvent(ur_exp_command_buffer_handle_t CommandBuffer,
1342
1343
&(CommandBuffer->SignalEvent ->ZeEvent )));
1343
1344
}
1344
1345
1345
- Event = RetEvent;
1346
+ if (Event) {
1347
+ *Event = RetEvent;
1348
+ }
1346
1349
1347
1350
return UR_RESULT_SUCCESS;
1348
1351
}
@@ -1405,9 +1408,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
1405
1408
ZE2UR_CALL (zeCommandListAppendEventReset,
1406
1409
(SignalCommandList->first , CommandBuffer->AllResetEvent ->ZeEvent ));
1407
1410
1408
- if (Event) {
1409
- UR_CALL ( createUserEvent (CommandBuffer, Queue, SignalCommandList, *Event));
1410
- }
1411
+ // Appends a wait on the main command-list signal and registers output Event
1412
+ // parameter with signal command-list completing.
1413
+ UR_CALL ( createUserEvent (CommandBuffer, Queue, SignalCommandList, Event));
1411
1414
1412
1415
UR_CALL (Queue->executeCommandList (SignalCommandList, false , false ));
1413
1416
0 commit comments