@@ -156,7 +156,7 @@ static const bool InOrderBarrierBySignal = [] {
156156 return (UrRet ? std::atoi (UrRet) : true );
157157}();
158158
159- ur_result_t EnqueueEventsWaitWithBarrier (
159+ ur_result_t urEnqueueEventsWaitWithBarrier (
160160 ur_queue_handle_t Queue, // /< [in] handle of the queue object
161161 uint32_t NumEventsInWaitList, // /< [in] size of the event wait list
162162 const ur_event_handle_t
@@ -166,9 +166,39 @@ ur_result_t EnqueueEventsWaitWithBarrier(
166166 // /< the numEventsInWaitList must be 0, indicating that
167167 // /< all previously enqueued commands must be complete.
168168 ur_event_handle_t
169- *OutEvent, // /< [in,out][optional] return an event object that
170- // /< identifies this particular command instance.
171- bool InterruptBasedEventsEnabled) {
169+ *OutEvent // /< [in,out][optional] return an event object that identifies
170+ // /< this particular command instance.
171+ ) {
172+ return ur::level_zero::urEnqueueEventsWaitWithBarrier (
173+ Queue, nullptr , NumEventsInWaitList, EventWaitList, OutEvent);
174+
175+ return static_cast <ur_result_t (*)(
176+ ur_queue_handle_t , uint32_t , const ur_event_handle_t *,
177+ ur_event_handle_t *, bool )>(EnqueueEventsWaitWithBarrier)(
178+ Queue, NumEventsInWaitList, EventWaitList, OutEvent,
179+ Queue == nullptr ? false : Queue->InterruptBasedEventsEnabled );
180+ }
181+
182+ ur_result_t urEnqueueEventsWaitWithBarrierExt (
183+ ur_queue_handle_t Queue, // /< [in] handle of the queue object
184+ const ur_exp_enqueue_ext_properties_t
185+ *EnqueueExtProp, // /< [in][optional] pointer to the extended enqueue
186+ uint32_t NumEventsInWaitList, // /< [in] size of the event wait list
187+ const ur_event_handle_t
188+ *EventWaitList, // /< [in][optional][range(0, numEventsInWaitList)]
189+ // /< pointer to a list of events that must be complete
190+ // /< before this command can be executed. If nullptr,
191+ // /< the numEventsInWaitList must be 0, indicating that
192+ // /< all previously enqueued commands must be complete.
193+ ur_event_handle_t
194+ *OutEvent // /< [in,out][optional] return an event object that identifies
195+ // /< this particular command instance.
196+ ) {
197+ bool InterruptBasedEventsEnabled =
198+ EnqueueExtProp
199+ ? (EnqueueExtProp->flags & UR_EXP_ENQUEUE_EXT_FLAG_LOW_POWER_EVENTS) |
200+ Queue->InterruptBasedEventsEnabled
201+ : Queue->InterruptBasedEventsEnabled ;
172202 // Lock automatically releases when this goes out of scope.
173203 std::scoped_lock<ur_shared_mutex> lock (Queue->Mutex );
174204
@@ -421,60 +451,6 @@ ur_result_t EnqueueEventsWaitWithBarrier(
421451 return UR_RESULT_SUCCESS;
422452}
423453
424- ur_result_t urEnqueueEventsWaitWithBarrier (
425- ur_queue_handle_t Queue, // /< [in] handle of the queue object
426- uint32_t NumEventsInWaitList, // /< [in] size of the event wait list
427- const ur_event_handle_t
428- *EventWaitList, // /< [in][optional][range(0, numEventsInWaitList)]
429- // /< pointer to a list of events that must be complete
430- // /< before this command can be executed. If nullptr,
431- // /< the numEventsInWaitList must be 0, indicating that
432- // /< all previously enqueued commands must be complete.
433- ur_event_handle_t
434- *OutEvent // /< [in,out][optional] return an event object that identifies
435- // /< this particular command instance.
436- ) {
437- return static_cast <ur_result_t (*)(
438- ur_queue_handle_t , uint32_t , const ur_event_handle_t *,
439- ur_event_handle_t *, bool )>(EnqueueEventsWaitWithBarrier)(
440- Queue, NumEventsInWaitList, EventWaitList, OutEvent,
441- Queue == nullptr ? false : Queue->InterruptBasedEventsEnabled );
442- }
443-
444- ur_result_t urEnqueueEventsWaitWithBarrierExt (
445- ur_queue_handle_t Queue, // /< [in] handle of the queue object
446- const ur_exp_enqueue_ext_properties_t
447- *EnqueueExtProp, // /< [in][optional] pointer to the extended enqueue
448- uint32_t NumEventsInWaitList, // /< [in] size of the event wait list
449- const ur_event_handle_t
450- *EventWaitList, // /< [in][optional][range(0, numEventsInWaitList)]
451- // /< pointer to a list of events that must be complete
452- // /< before this command can be executed. If nullptr,
453- // /< the numEventsInWaitList must be 0, indicating that
454- // /< all previously enqueued commands must be complete.
455- ur_event_handle_t
456- *OutEvent // /< [in,out][optional] return an event object that identifies
457- // /< this particular command instance.
458- ) {
459- bool InterruptBased =
460- EnqueueExtProp
461- ? (EnqueueExtProp->flags & UR_EXP_ENQUEUE_EXT_FLAG_LOW_POWER_EVENTS)
462- : false ;
463- if (InterruptBased) {
464- // Create the event with interrupt-based properties
465- return static_cast <ur_result_t (*)(
466- ur_queue_handle_t , uint32_t , const ur_event_handle_t *,
467- ur_event_handle_t *, bool )>(EnqueueEventsWaitWithBarrier)(
468- Queue, NumEventsInWaitList, EventWaitList, OutEvent, true );
469- } else {
470- return static_cast <ur_result_t (*)(
471- ur_queue_handle_t , uint32_t , const ur_event_handle_t *,
472- ur_event_handle_t *, bool )>(EnqueueEventsWaitWithBarrier)(
473- Queue, NumEventsInWaitList, EventWaitList, OutEvent,
474- Queue->InterruptBasedEventsEnabled || false );
475- }
476- }
477-
478454ur_result_t urEventGetInfo (
479455 ur_event_handle_t Event, // /< [in] handle of the event object
480456 ur_event_info_t PropName, // /< [in] the name of the event property to query
0 commit comments