Skip to content

Commit 21063c6

Browse files
sommerlukasbb-sycl
authored andcommitted
[SYCL][Fusion] Add missing event waits (intel#1563)
1 parent c9f5f7a commit 21063c6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

SYCL/KernelFusion/event_wait_complete.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,17 @@ int main() {
6161
// The execution of the fused kennel does not depend on any events.
6262
assert(complete.get_wait_list().size() == 0);
6363

64+
// Need to wait for the event 'kernel1' here, as it is the event associated
65+
// with the placeholder, which depends on 'complete', but is a separate event.
66+
kernel1.wait();
6467
assert(isEventComplete(kernel1) && "Event should be complete");
6568
// The event returned for submissions while in fusion mode depends on three
6669
// events, for the two original kernels (which do not execute) and the fused
6770
// kernel to be executed.
6871
assert(kernel1.get_wait_list().size() == 3);
6972

73+
// 'kernel2' is the same event (associated with the placeholder) as 'kernel1',
74+
// so no need to wait again.
7075
assert(isEventComplete(kernel2) && "Event should be complete");
7176
// The event returned for submissions while in fusion mode depends on three
7277
// events, for the two original kernels (which do not execute) and the fused

SYCL/KernelFusion/internal_explicit_dependency.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ int main() {
6161
complete.wait();
6262
assert(isEventComplete(complete) && "Event should be complete");
6363

64+
// Need to wait for the event 'kernel1' here, as it is the event associated
65+
// with the placeholder, which depends on 'complete', but is a separate event.
66+
kernel1.wait();
6467
assert(isEventComplete(kernel1) && "Event should be complete");
6568

69+
// 'kernel2' is the same event (associated with the placeholder) as 'kernel1',
70+
// so no need to wait again.
6671
assert(isEventComplete(kernel2) && "Event should be complete");
6772

6873
// Check the results

0 commit comments

Comments
 (0)