Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][Fusion] Add missing event waits #1563

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SYCL/KernelFusion/event_wait_complete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ int main() {
// The execution of the fused kennel does not depend on any events.
assert(complete.get_wait_list().size() == 0);

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

// 'kernel2' is the same event (associated with the placeholder) as 'kernel1',
// so no need to wait again.
assert(isEventComplete(kernel2) && "Event should be complete");
// The event returned for submissions while in fusion mode depends on three
// events, for the two original kernels (which do not execute) and the fused
Expand Down
5 changes: 5 additions & 0 deletions SYCL/KernelFusion/internal_explicit_dependency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ int main() {
complete.wait();
assert(isEventComplete(complete) && "Event should be complete");

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

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

// Check the results
Expand Down