Skip to content

Commit b478e9a

Browse files
committed
Move flush buffer initialization on device into __init
Signed-off-by: Mikhail Lychkov <[email protected]>
1 parent bc599c6 commit b478e9a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sycl/include/CL/sycl/stream.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ class __SYCL_EXPORT stream {
841841
// overhead on FPGA target. That is why use global atomic variable to
842842
// calculate offsets.
843843
WIOffset = GlobalOffset[1].fetch_add(FlushBufferSize);
844+
SetFlushBufOffset(GlobalFlushBuf, WIOffset, 0);
844845
}
845846

846847
void __finalize() {

sycl/source/detail/scheduler/scheduler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ EventImplPtr Scheduler::addCG(std::unique_ptr<detail::CG> CommandGroup,
7575

7676
if (IsKernel) {
7777
Streams = ((CGExecKernel *)CommandGroup.get())->getStreams();
78-
// Initializing stream's flush buffer on the host side.
79-
for (auto StreamImplPtr : Streams) {
80-
StreamImplPtr->fill(Queue);
78+
if (Queue->is_host()) {
79+
// Initializing stream's flush buffer on the host side.
80+
for (auto StreamImplPtr : Streams) {
81+
StreamImplPtr->fill(Queue);
82+
}
8183
}
8284
}
8385

0 commit comments

Comments
 (0)