@@ -365,6 +365,10 @@ pi_result hip_piEnqueueEventsWait(pi_queue command_queue,
365
365
pi_uint32 num_events_in_wait_list,
366
366
const pi_event *event_wait_list,
367
367
pi_event *event);
368
+ pi_result hip_piEnqueueEventsWaitWithBarrier (pi_queue command_queue,
369
+ pi_uint32 num_events_in_wait_list,
370
+ const pi_event *event_wait_list,
371
+ pi_event *event);
368
372
pi_result hip_piEventRelease (pi_event event);
369
373
pi_result hip_piEventRetain (pi_event event);
370
374
@@ -3436,13 +3440,30 @@ pi_result hip_piEventRelease(pi_event event) {
3436
3440
return PI_SUCCESS;
3437
3441
}
3438
3442
3439
- // / Enqueues a wait on the given CUstream for all events.
3443
+ // / Enqueues a wait on the given queue for all events.
3440
3444
// / See \ref enqueueEventWait
3441
3445
// /
3446
+ // / Currently queues are represented by a single in-order stream, therefore
3447
+ // / every command is an implicit barrier and so hip_piEnqueueEventsWait has the
3448
+ // / same behavior as hip_piEnqueueEventsWaitWithBarrier. So
3449
+ // / hip_piEnqueueEventsWait can just call hip_piEnqueueEventsWaitWithBarrier.
3442
3450
pi_result hip_piEnqueueEventsWait (pi_queue command_queue,
3443
3451
pi_uint32 num_events_in_wait_list,
3444
3452
const pi_event *event_wait_list,
3445
3453
pi_event *event) {
3454
+ return hip_piEnqueueEventsWaitWithBarrier (
3455
+ command_queue, num_events_in_wait_list, event_wait_list, event);
3456
+ }
3457
+
3458
+ // / Enqueues a wait on the given queue for all specified events.
3459
+ // / See \ref enqueueEventWaitWithBarrier
3460
+ // /
3461
+ // / If the events list is empty, the enqueued wait will wait on all previous
3462
+ // / events in the queue.
3463
+ pi_result hip_piEnqueueEventsWaitWithBarrier (pi_queue command_queue,
3464
+ pi_uint32 num_events_in_wait_list,
3465
+ const pi_event *event_wait_list,
3466
+ pi_event *event) {
3446
3467
if (!command_queue) {
3447
3468
return PI_INVALID_QUEUE;
3448
3469
}
@@ -4886,6 +4907,7 @@ pi_result piPluginInit(pi_plugin *PluginInit) {
4886
4907
_PI_CL (piEnqueueKernelLaunch, hip_piEnqueueKernelLaunch)
4887
4908
_PI_CL (piEnqueueNativeKernel, hip_piEnqueueNativeKernel)
4888
4909
_PI_CL (piEnqueueEventsWait, hip_piEnqueueEventsWait)
4910
+ _PI_CL (piEnqueueEventsWaitWithBarrier, hip_piEnqueueEventsWaitWithBarrier)
4889
4911
_PI_CL (piEnqueueMemBufferRead, hip_piEnqueueMemBufferRead)
4890
4912
_PI_CL (piEnqueueMemBufferReadRect, hip_piEnqueueMemBufferReadRect)
4891
4913
_PI_CL (piEnqueueMemBufferWrite, hip_piEnqueueMemBufferWrite)
0 commit comments