Skip to content

Commit 4acfa39

Browse files
GagaLPPeterTh
authored andcommitted
Remove flush_async workaround as it is no longer needed in newer ACPP versions
1 parent 6b90ee3 commit 4acfa39

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Versioning](http://semver.org/spec/v2.0.0.html).
3131
- Celerity warns on excessive calls to `queue::wait()` or `distr_queue::slow_full_sync()` in a long running program.
3232
This operation has a much more pronounced performance penalty than its SYCL counterpart (#283)
3333
- On systems that do not support device-to-device copies, data is now staged in linearized buffers for better performance (#287)
34+
- Removed the flush_async workaround for newer ACPP versions, keeping compatibility with older versions (#333)
3435
- The `access::neighborhood` built-in range mapper now receives a `range` instead of a coordinate list (#292)
3536
- Overhauled the [installation](docs/installation.md) and [configuration](docs/configuration.md) documentation (#309)
3637
- Celerity will now queue up several command groups in order to combine allocations and elide resize operations.

src/backend/sycl_backend.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,17 @@ std::optional<std::chrono::nanoseconds> delayed_async_event::get_native_executio
6565
return m_state->m_event.get_native_execution_time();
6666
}
6767

68+
template <typename DagManager>
69+
static void try_flush_async(DagManager& dag) {
70+
// AdaptiveCpp (prior to https://github.com/AdaptiveCpp/AdaptiveCpp/pull/1798) does not guarantee that command groups are actually scheduled until an
71+
// explicit await operation, which we cannot insert without blocking the executor loop (see https://github.com/AdaptiveCpp/AdaptiveCpp/issues/599). Instead,
72+
// we explicitly flush the queue to be able to continue using our polling-based approach.
73+
if constexpr(requires { dag.flush_async(); }) { dag.flush_async(); }
74+
}
75+
6876
void flush(sycl::queue& queue) {
6977
#if CELERITY_WORKAROUND(ACPP)
70-
// AdaptiveCpp does not guarantee that command groups are actually scheduled until an explicit await operation, which we cannot insert without
71-
// blocking the executor loop (see https://github.com/AdaptiveCpp/AdaptiveCpp/issues/599). Instead, we explicitly flush the queue to be able to continue
72-
// using our polling-based approach.
73-
queue.get_context().AdaptiveCpp_runtime()->dag().flush_async();
78+
try_flush_async(queue.get_context().AdaptiveCpp_runtime()->dag());
7479
#else
7580
(void)queue;
7681
#endif

0 commit comments

Comments
 (0)