Skip to content

Fix ACPP Stream Semantics - #65

Merged
davschneller merged 4 commits into
masterfrom
davschneller/acpp-stream-semantics
Sep 28, 2026
Merged

davschneller merged 4 commits into
masterfrom
davschneller/acpp-stream-semantics

Conversation

@davschneller

Copy link
Copy Markdown
Contributor
  • fix queue waits
  • fix ACPP host functions

AdaptiveCpp has no host_task, so streamHostFunction enqueued the
function as a custom operation. AdaptiveCpp evaluates a custom operation
when it is submitted, not once the operations before it on the queue
have completed (its doc/enqueue-custom-operation.md says so explicitly):
the function ran on the host right away, while e.g. a copy it depends on
could still be running. With AdaptiveCpp, streamHostFunction now waits
for the queue and then runs the function, as SeisSol already does on
HIP.

AI-generated. Model: Claude Opus 5.5
isStreamWorkDone asked AdaptiveCpp for the wait list of the queue and
reported the queue as done if that was empty. For an in-order queue that
AdaptiveCpp does not emulate, which is what Device creates, get_wait_list
submits a new barrier and returns it, so the list is never empty: a
caller polling isStreamWorkDone (as SeisSol does for the host MPI
transfer mode) waits forever, and each poll adds another operation to the
queue. It now uses the queue-empty query of SYCL_KHR_QUEUE_EMPTY_QUERY,
which AdaptiveCpp provides, and synchronizes if neither that nor the
oneAPI extension is available.

AI-generated. Model: Claude Opus 5.5
A host function enqueued on a stream must see the result of the copies
enqueued before it, and a stream that has been synchronized must report
its work as done within a bounded number of polls. With AdaptiveCpp,
both failed before the two previous fixes: a custom operation ran at
submission (or, in the library-only OpenMP mode, could not be launched
at all), and isStreamWorkDone never returned true. Both tests pass with
CUDA and with AdaptiveCpp (omp.library-only).

AI-generated. Model: Claude Opus 5.5
DeviceCircularQueueBuffer::deleteQueue deleted a queue made by
newQueue, but left its pointer in externalQueues. The next
syncAllQueuesWithHost (e.g. syncDevice, or the synchronization at
teardown) then waited on the deleted queue: with AdaptiveCpp that
crashed, with oneAPI it raised a SYCL error. SeisSol destroys streams
in the ghost clusters, and the new stream tests destroy theirs before
later tests synchronize the device, which is how the SYCL test jobs
failed. The queue is now removed from externalQueues before it is
deleted, and a test synchronizes the device after destroying a stream.

AI-generated. Model: Claude Opus 5.5
@davschneller
davschneller merged commit aaa7664 into master Sep 28, 2026
17 checks passed
@davschneller
davschneller deleted the davschneller/acpp-stream-semantics branch September 28, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant