Skip to content

[UR][L0] Correctly wait on barrier on urEnqueueEventsWaitWithBarrier #11541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2023
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
12 changes: 6 additions & 6 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
include(FetchContent)

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit ce4acbc4e479c3e8c591f345f7ba30345a8a2a40
# Merge: 76aaf05c 28590a82
# commit e69ed21468e04ed6e832accf162422ed11736446
# Merge: 20fa0b5f 7fd9dafd
# Author: Kenneth Benzie (Benie) <[email protected]>
# Date: Wed Dec 6 17:13:51 2023 +0000
# Merge pull request #1099 from jandres742/largeallocations
# [UR][L0] Unify use of large allocation in L0 adapter
set(UNIFIED_RUNTIME_TAG ce4acbc4e479c3e8c591f345f7ba30345a8a2a40)
# Date: Fri Dec 8 12:18:51 2023 +0000
# Merge pull request #962 from jandres742/fixwaitbarrierwithevent
# [UR][L0] Correctly wait on barrier on urEnqueueEventsWaitWithBarrier
set(UNIFIED_RUNTIME_TAG e69ed21468e04ed6e832accf162422ed11736446)

if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")
Expand Down
27 changes: 27 additions & 0 deletions sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
int main() {
sycl::queue Q1({sycl::property::queue::in_order{}});
sycl::queue Q2({sycl::property::queue::in_order{}});
sycl::queue Q3({sycl::property::queue::in_order{},
sycl::property::queue::enable_profiling{}});

// Test case 1 - events in the barrier's waitlist are from different queues.
std::cout << "Test1" << std::endl;
Expand Down Expand Up @@ -126,5 +128,30 @@ int main() {
assert(Event11.get_info<sycl::info::event::command_execution_status>() ==
sycl::info::event_command_status::complete);

// Test case 6 - submit barrier after queue sync with profiling enabled, i.e.
// last event = nullptr.
std::cout << "Test3" << std::endl;
auto Event12 = Q3.submit(
[&](sycl::handler &cgh) { cgh.single_task<class kernel12>([]() {}); });
auto Event13 = Q3.submit(
[&](sycl::handler &cgh) { cgh.single_task<class kernel13>([]() {}); });
Q3.wait();

// CHECK: Test3
// CHECK: ---> piEnqueueEventsWaitWithBarrier(
// CHECK: ZE ---> zeEventCreate
// CHECK-NOT: ZE ---> zeCommandListAppendWaitOnEvents
// CHECK-NOT: ZE ---> zeCommandListAppendSignalEvent
// CHECK: ZE ---> zeCommandListAppendBarrier
// CHECK: ) ---> pi_result : PI_SUCCESS
auto BarrierEvent6 = Q3.ext_oneapi_submit_barrier({Event12, Event13});
BarrierEvent6.wait();

// Check that kernel events are completed after waiting for barrier event.
assert(Event12.get_info<sycl::info::event::command_execution_status>() ==
sycl::info::event_command_status::complete);
assert(Event13.get_info<sycl::info::event::command_execution_status>() ==
sycl::info::event_command_status::complete);

return 0;
}