@@ -156,7 +156,7 @@ static const bool InOrderBarrierBySignal = [] {
156
156
return (UrRet ? std::atoi (UrRet) : true );
157
157
}();
158
158
159
- ur_result_t EnqueueEventsWaitWithBarrier (
159
+ ur_result_t urEnqueueEventsWaitWithBarrier (
160
160
ur_queue_handle_t Queue, // /< [in] handle of the queue object
161
161
uint32_t NumEventsInWaitList, // /< [in] size of the event wait list
162
162
const ur_event_handle_t
@@ -166,9 +166,33 @@ ur_result_t EnqueueEventsWaitWithBarrier(
166
166
// /< the numEventsInWaitList must be 0, indicating that
167
167
// /< all previously enqueued commands must be complete.
168
168
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::urEnqueueEventsWaitWithBarrierExt (
173
+ Queue, nullptr , NumEventsInWaitList, EventWaitList, OutEvent);
174
+ }
175
+
176
+ ur_result_t urEnqueueEventsWaitWithBarrierExt (
177
+ ur_queue_handle_t Queue, // /< [in] handle of the queue object
178
+ const ur_exp_enqueue_ext_properties_t
179
+ *EnqueueExtProp, // /< [in][optional] pointer to the extended enqueue
180
+ uint32_t NumEventsInWaitList, // /< [in] size of the event wait list
181
+ const ur_event_handle_t
182
+ *EventWaitList, // /< [in][optional][range(0, numEventsInWaitList)]
183
+ // /< pointer to a list of events that must be complete
184
+ // /< before this command can be executed. If nullptr,
185
+ // /< the numEventsInWaitList must be 0, indicating that
186
+ // /< all previously enqueued commands must be complete.
187
+ ur_event_handle_t
188
+ *OutEvent // /< [in,out][optional] return an event object that identifies
189
+ // /< this particular command instance.
190
+ ) {
191
+ bool InterruptBasedEventsEnabled =
192
+ EnqueueExtProp
193
+ ? (EnqueueExtProp->flags & UR_EXP_ENQUEUE_EXT_FLAG_LOW_POWER_EVENTS) |
194
+ Queue->InterruptBasedEventsEnabled
195
+ : Queue->InterruptBasedEventsEnabled ;
172
196
// Lock automatically releases when this goes out of scope.
173
197
std::scoped_lock<ur_shared_mutex> lock (Queue->Mutex );
174
198
@@ -421,60 +445,6 @@ ur_result_t EnqueueEventsWaitWithBarrier(
421
445
return UR_RESULT_SUCCESS;
422
446
}
423
447
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
-
478
448
ur_result_t urEventGetInfo (
479
449
ur_event_handle_t Event, // /< [in] handle of the event object
480
450
ur_event_info_t PropName, // /< [in] the name of the event property to query
0 commit comments