|
MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
|
Runtime access to the CUDA timestamp-sort kernel. More...
#include <GpuAccel.hpp>
Public Types | |
| typedef int(* | SortFunc) (void *, long long) |
| Signature of the sort entry point: buffer, element count, status. | |
Static Public Member Functions | |
| static Bool_t | Init () |
| Load the GPU library and resolve the sort symbol. | |
| static Bool_t | Available () |
| Whether the kernel loaded successfully. | |
| static SortFunc | GetSort () |
| The resolved sort entry point. | |
| static Bool_t | TryAcquireSortSlot () |
| Claim one of the concurrent GPU sort slots. | |
| static void | ReleaseSortSlot () |
| Give back a slot claimed by TryAcquireSortSlot(). | |
Runtime access to the CUDA timestamp-sort kernel.
The kernel lives in libgpuaccel.so, built from tooling/gpu/ and loaded with dlopen at first use rather than linked. That keeps the tooling runnable on a machine with no CUDA runtime: if the library or its symbol is missing, every entry point here degrades to reporting unavailable and the caller takes the CPU path.
All state is process-global and initialised once.
Definition at line 21 of file GpuAccel.hpp.
| typedef int(* GpuAccel::SortFunc) (void *, long long) |
Signature of the sort entry point: buffer, element count, status.
Definition at line 24 of file GpuAccel.hpp.
|
static |
Whether the kernel loaded successfully.
Definition at line 41 of file GpuAccel.cpp.
Referenced by Timing::SortHitsByTimestamp().
|
static |
The resolved sort entry point.
Definition at line 43 of file GpuAccel.cpp.
Referenced by Timing::SortHitsByTimestamp().
|
static |
Load the GPU library and resolve the sort symbol.
Idempotent.
Does nothing and reports unavailable when Constants::cfg.USE_GPU_ACCELERATION is off. The library path is baked in at build time by the Makefile, falling back to a bare libgpuaccel.so resolved through LD_LIBRARY_PATH.
Definition at line 9 of file GpuAccel.cpp.
Referenced by Pipeline::Run().
|
static |
Give back a slot claimed by TryAcquireSortSlot().
Definition at line 53 of file GpuAccel.cpp.
Referenced by Timing::SortHitsByTimestamp().
|
static |
Claim one of the concurrent GPU sort slots.
The pipeline processes subfiles in parallel, so without a cap they would all dispatch to the GPU at once and exhaust device memory. Constants::cfg.MAX_GPU_CONCURRENT_SORTS bounds how many may be in flight.
Definition at line 45 of file GpuAccel.cpp.
Referenced by Timing::SortHitsByTimestamp().