forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Disable in-order queue barrier optimization while profiling (i…
…ntel#14123) Current implementation of profiling info for NOP barriers is inconsistent with other events from the same queue (e.g., if the previous event started after the barrier was submitted). To make them consistent while keeping the optimization, we would need to duplicate the event on our side and make the duplicate check and potentially use profiling info of its previous event. Instead, as the first step, disable the NOP optimization during profiling since profiling is known to incur a performance hit anyway. The proper duplicate event approach can be implemented as a follow up if this causes issues for users. Partially reverts intel#12949
- Loading branch information
1 parent
80eb9f5
commit 292fdda
Showing
5 changed files
with
50 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
|
||
//==----------------- in_order_barrier_profiling.cpp -----------------------==// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// Level Zero adapter has a similar in-order queue barrier optimization that | ||
// leads to incorrect profiling values. | ||
// UNSUPPORTED: level_zero | ||
#include <sycl/detail/core.hpp> | ||
|
||
#include <sycl/properties/all_properties.hpp> | ||
|
||
using namespace sycl; | ||
|
||
// Checks that the barrier profiling info is consistent with the previous | ||
// command, despite the fact that the latter started after the barrier was | ||
// submitted. | ||
int main() { | ||
queue Q({property::queue::in_order(), property::queue::enable_profiling()}); | ||
|
||
buffer<int, 1> Buf(range<1>(1)); | ||
event KernelEvent; | ||
event BarrierEvent; | ||
{ | ||
auto HostAcc = Buf.get_access(); | ||
KernelEvent = Q.submit([&](handler &cgh) { | ||
auto Acc = Buf.get_access(cgh); | ||
cgh.single_task([=]() {}); | ||
}); | ||
BarrierEvent = Q.ext_oneapi_submit_barrier(); | ||
} | ||
uint64_t KernelEnd = | ||
KernelEvent.get_profiling_info<info::event_profiling::command_end>(); | ||
uint64_t BarrierStart = | ||
BarrierEvent.get_profiling_info<info::event_profiling::command_start>(); | ||
assert(KernelEnd <= BarrierStart); | ||
} |
This file was deleted.
Oops, something went wrong.