Asynchronous Algorithms
Introduce AthAsynchronousAlgorithm
and use it in AthExCUDA
.
This implements the Athena side of AsynchronousAlgorithms, our mechanism for running GPU accelerated algorithms in a asynchronous fashion to avoid leaving CPU cores idle while work is run on a GPU.
This is implemented by introducing the AthAsynchronousAlgorithm
which runs on a small pool of threads managed by Boost Fiber. These Fibers can be suspended while work runs on the GPU, freeing up the CPU core until the GPU work is done. The basic framework and a simple example are included in this MR.
Existing CUDA code that wishes to use this mechanism must opt-in by:
- Inheriting from
AthAsynchronousAlgorithm
instead ofAthReentrantAlgorithm
, and - Using the provided CUDA stream wrapper, and calling the
.await()
method while waiting for work to complete.
For more details see slide 8 onwards of this talk from CHEP 2024.
Edited by Beojan Stanislaus