lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::Gpu Namespace Reference

Namespace of the GPU DRP code (psdaq/drpGpu); only Gpu::Detector is forward-declared here. More...

Classes

class  AreaDetector
 GPU DRP detector for detType fakecam (registered in PGPDetectorApp). More...
 
class  CoreRegisters
 Access to the GpuAsyncCore registers, either through a GpuAsyncCoreRegs object on the mapped firmware registers or, in simulator mode, through a plain memory block laid out like them. More...
 
class  CudaContext
 Wraps a cuda context and handles some initialization for you. More...
 
class  CuSZpReducer
 Reducer that compresses each calibrated buffer with cuSZp (cuSZp_compress_1D_plain_f32) using an error bound of 1.2e-4 (absolute, per the code comment). More...
 
class  CuSzReducer
 Reducer that compresses each calibrated buffer with cuSZ (Lorenzo predictor, relative error bound 1.2e-4, Huffman coding). More...
 
class  DataDev
 Wraps a data_dev device so it can be automatically freed. More...
 
class  Detector
 Base of the GPU DRP detectors (Drp::Gpu::Detector). More...
 
class  DetectorFactory
 Creates GPU detectors from shared libraries: each detector type name is mapped to a library that defines createDetector(). More...
 
struct  DetPanel
 The PGP device of the GPU DRP and the GPU resources tied to it. More...
 
class  EipReducer
 Reducer that compresses each calibrated buffer with EIP::Compressor. More...
 
class  EpixUHRemu
 GPU DRP detector for detType epixuhremu (registered in PGPDetectorApp). More...
 
class  EpixUHRsim
 Simulated GPU DRP detector for detType epixuhrsim (registered in PGPDetectorApp). More...
 
class  FileWriter
 Writes event data that is already in GPU memory to a file with NVIDIA cuFile. More...
 
class  FileWriterAsync
 FileWriter that splits its GPU buffer into two halves: a filled half is written with cuFileWriteAsync on the registered stream while events are copied into the other half. More...
 
struct  GPUTimer
 Class for timing various things. More...
 
class  LcReducer
 Reducer that compresses each calibrated buffer with an LC framework compressor (the QUANT_ABS_0_f32, BIT_4, RZE_1 pipeline, per the included header name), recorded into the Reducer graph. More...
 
class  MemPoolGpu
 Memory pool of the GPU DRP. More...
 
class  NoOpReducer
 Reducer that copies the calibrated floats unchanged into the output buffer, using its own CUDA kernel. More...
 
class  PfplReducer
 Reducer that compresses each calibrated buffer with PFPL::Compressor (from f32_abs_comp_gpu.hh), recorded into the Reducer graph. More...
 
class  PGPDetectorApp
 Collection application of the GPU DRP: handles the control transitions and drives a Drp::Gpu::PGPDrp and the GPU detector. More...
 
class  PGPDrp
 DRP for the GPU detectors (Drp::Gpu::PGPDrp). More...
 
struct  Ptr
 Pair of pointers of type T, one for the host and one for the device; Reducer uses it for each ring queue object and its device copy. More...
 
class  Reader
 Receives the FPGA DMA buffers on the GPU. More...
 
struct  ReaderMetrics
 Per-reader counters in pinned host memory, exported by Reader::setupMetrics(); the kernels update them only if DBG is enabled in Reader.cu. More...
 
class  Reducer
 Runs the data reduction on the GPU for PGPDrp: loads the reducer library named by the reducer kwarg, creates one ReducerAlgo per worker, and passes buffer indices in and ReducerTuple results out through per-worker queues. More...
 
class  ReducerAlgo
 Base of the GPU data reduction algorithms. More...
 
struct  ReducerMetrics
 Per-worker counters in pinned host memory, exported by Reducer::setupMetrics(). More...
 
struct  ReducerTuple
 Result of reducing one buffer, passed from the reducer back to the recorder. More...
 
class  RingIndexDtoD
 Lock-free ring of buffer indices with a device producer (push()) and a device consumer (pop()). More...
 
class  RingIndexDtoH
 Lock-free ring of buffer indices with a device producer (push()) and a host consumer (pop()). More...
 
class  RingIndexHtoD
 Lock-free ring of buffer indices with one host producer (push()) and one device consumer (pop()). More...
 
class  RingQueueDtoD
 Lock-free ring of values of type T with one producer on the GPU (push()) and one consumer on the GPU (pop()). More...
 
class  RingQueueDtoH
 Lock-free ring of values of type T with one producer on the GPU (push()) and one consumer on the host (pop()). More...
 
class  RingQueueHtoD
 Lock-free ring of values of type T with one producer on the host (push()) and one consumer on the GPU (pop()). More...
 
class  SimDetector
 Base of simulated GPU detectors (EpixUHRsim uses it). More...
 
class  SleekReducer
 Reducer that compresses each calibrated buffer with SLEEK::SingleCompressorLossy, recorded into the Reducer graph. More...
 
class  TebReceiver
 TebReceiver of the GPU DRP. More...
 
struct  TebReceiverMetrics
 Counters of the GPU TebReceiver, exported by TebReceiver::setupMetrics(). More...
 
class  TrgInpGen
 Runs the trigger primitive for each received buffer in a self-relaunching CUDA graph, taking buffers from the reader queues in turn and passing them to the host through a ring queue. More...
 
struct  TrgInpGenMetrics
 Counters of TrgInpGen, exported by TrgInpGen::setupMetrics(). More...
 

Typedefs

using ResultTuple = std::tuple< unsigned, const Pds::Eb::ResultDgram * >
 Buffer index and TEB result, queued by TebReceiver::complete() for the recorder thread.
 

Enumerations

enum  { MaxPnlsPerNode = 10 }
 Panel limit used to space the NamesId indices below. More...
 
enum  { ConfigNamesIndex = Drp::NamesIndex::BASE , EventNamesIndex = unsigned(ConfigNamesIndex) + unsigned(MaxPnlsPerNode) , FexNamesIndex = unsigned(EventNamesIndex) + unsigned(MaxPnlsPerNode) , ReducerNamesIndex }
 NamesId indices for the xtc names of the GPU DRP (per the code comment). More...
 
enum  DmaTgt_t { TGT_CPU =0x0 , TGT_GPU =0x1 , TGT_ERR =-1u }
 Functions to get and set the DMA destination. More...
 

Functions

bool checkError (CUresult status, const char *func, const char *file, int line, bool crash=true, const char *msg="")
 If status is not CUDA_SUCCESS, log file, line, the error name and description and msg, then abort if crash is true.
 
bool checkError (cudaError status, const char *func, const char *file, int line, bool crash=true, const char *msg="")
 If status is not cudaSuccess, log file, line, the error name and description and msg, then abort if crash is true.
 
DmaTgt_t dmaTgtGet (CoreRegisters &)
 Return TGT_CPU or TGT_GPU for the AXI stream demux select value of coreRegs, or TGT_ERR for any other value.
 
void dmaTgtSet (CoreRegisters &, DmaTgt_t)
 Write tgt to the AXI stream demux select field of coreRegs.
 
void dmaIdxReset (CoreRegisters &)
 Function to reset the DMA buffer round-robin index.
 
struct __attribute__ ((packed)) DmaDsc
 DmaDsc: the 8-byte DMA descriptor (header word and size word) defined by AxiStreamDmaV2Write.vhd in the SURF library (per the code comment).
 

Detailed Description

Namespace of the GPU DRP code (psdaq/drpGpu); only Gpu::Detector is forward-declared here.

Typedef Documentation

◆ ResultTuple

using Drp::Gpu::ResultTuple = typedef std::tuple<unsigned, const Pds::Eb::ResultDgram*>

Buffer index and TEB result, queued by TebReceiver::complete() for the recorder thread.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Panel limit used to space the NamesId indices below.

Enumerator
MaxPnlsPerNode 

Maximum number of panels per node, 10 (per the code comment, taken from BEBDetector.hh).

◆ anonymous enum

anonymous enum

NamesId indices for the xtc names of the GPU DRP (per the code comment).

Enumerator
ConfigNamesIndex 

Drp::NamesIndex::BASE.

EventNamesIndex 

ConfigNamesIndex plus MaxPnlsPerNode.

FexNamesIndex 

EventNamesIndex plus MaxPnlsPerNode.

ReducerNamesIndex 

FexNamesIndex plus 1; the reducers register the names of the reduced data under it.

◆ DmaTgt_t

Functions to get and set the DMA destination.

Parameters
fdThe file descriptor of the PGP PCIe device
modeThe enumerated value of the destination
Enumerator
TGT_CPU 

Value 0: destination CPU.

TGT_GPU 

Value 1: destination GPU.

TGT_ERR 

Returned by dmaTgtGet() for any other register value.

Function Documentation

◆ __attribute__()

struct Drp::Gpu::__attribute__ ( (packed)  )

DmaDsc: the 8-byte DMA descriptor (header word and size word) defined by AxiStreamDmaV2Write.vhd in the SURF library (per the code comment).

Doxygen parses this packed struct as a function named attribute.

◆ checkError() [1/2]

bool Drp::Gpu::checkError ( cudaError  status,
const char *  func,
const char *  file,
int  line,
bool  crash = true,
const char *  msg = "" 
)

If status is not cudaSuccess, log file, line, the error name and description and msg, then abort if crash is true.

Returns true on failure, else false; func is not used.

◆ checkError() [2/2]

bool Drp::Gpu::checkError ( CUresult  status,
const char *  func,
const char *  file,
int  line,
bool  crash = true,
const char *  msg = "" 
)

If status is not CUDA_SUCCESS, log file, line, the error name and description and msg, then abort if crash is true.

Returns true on failure, else false; func is not used.

◆ dmaIdxReset()

void Drp::Gpu::dmaIdxReset ( CoreRegisters &  )

Function to reset the DMA buffer round-robin index.

Parameters
fdThe file descriptor of the PGP PCIe device

◆ dmaTgtGet()

DmaTgt_t Drp::Gpu::dmaTgtGet ( CoreRegisters &  )

Return TGT_CPU or TGT_GPU for the AXI stream demux select value of coreRegs, or TGT_ERR for any other value.

◆ dmaTgtSet()

void Drp::Gpu::dmaTgtSet ( CoreRegisters &  ,
DmaTgt_t   
)

Write tgt to the AXI stream demux select field of coreRegs.

MemPoolGpu sets TGT_GPU so that timing messages are sent to the GPU (per its code comment).