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

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...

#include <LcReducer.hh>

Inherits Drp::Gpu::ReducerAlgo.

Public Member Functions

 LcReducer (const Parameters &para, const MemPoolGpu &pool, Detector &det)
 Construct the compressor with the calibrated buffer size and the value 3; print its banner if verbose is set.
 
virtual ~LcReducer ()
 Does nothing; empty body.
 
bool hasGraph () const override
 Return true: the compressor is recorded into the Reducer graph.
 
size_t payloadSize () const override
 Return the maximum compressed size reported by the compressor (maxSize()).
 
void recordGraph (cudaStream_t stream, unsigned *const state_d, unsigned *const index_d, float const *const calibBuffers_d, size_t const calibBufsCnt, uint8_t *const dataBuffers_d, size_t const dataBufsCnt) override
 Let the compressor record its kernels into the captured stream (LC_framework::Compressor::updateGraph()) for the state, index, calibrated and data buffers, with buffer sizes given in bytes.
 
void reduce (cudaGraphExec_t, cudaStream_t, unsigned index, size_t *dataSize, unsigned *retCode) override
 Launch graph on stream and queue an asynchronous copy of the reduced size, stored just before data buffer index, to *dataSize; *retCode is set to 0.
 
int configure (const nlohmann::json &configureMsg, const nlohmann::json &connectMsg, size_t collectionId) override
 Return 0; nothing is configured.
 
unsigned configure (XtcData::Xtc &, const void *bufEnd) override
 Add the names of the reduced data (algorithm lc, one UINT8 array named lc) under ReducerNamesIndex and register them in the detector's names lookup; returns 0.
 
void event (XtcData::Xtc &, const void *bufEnd, unsigned dataSize) override
 Set the shape of the lc array to dataSize elements in the data description; the data itself stays on the GPU.
 
- Public Member Functions inherited from Drp::Gpu::ReducerAlgo
 ReducerAlgo (const Parameters &para, const MemPoolGpu &pool, Detector &det)
 Keep references to the parameters, the memory pool and the detector.
 
virtual ~ReducerAlgo ()
 Does nothing; empty virtual destructor.
 

Additional Inherited Members

- Protected Attributes inherited from Drp::Gpu::ReducerAlgo
const Parameters & m_para
 
const MemPoolGpu & m_pool
 
Detector & m_det
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LcReducer()

Drp::Gpu::LcReducer::LcReducer ( const Parameters &  para,
const MemPoolGpu &  pool,
Detector &  det 
)

Construct the compressor with the calibrated buffer size and the value 3; print its banner if verbose is set.

◆ ~LcReducer()

virtual Drp::Gpu::LcReducer::~LcReducer ( )
inlinevirtual

Does nothing; empty body.

Member Function Documentation

◆ configure() [1/2]

int Drp::Gpu::LcReducer::configure ( const nlohmann::json &  configureMsg,
const nlohmann::json &  connectMsg,
size_t  collectionId 
)
inlineoverridevirtual

Return 0; nothing is configured.

Implements Drp::Gpu::ReducerAlgo.

◆ configure() [2/2]

unsigned Drp::Gpu::LcReducer::configure ( XtcData::Xtc &  ,
const void *  bufEnd 
)
overridevirtual

Add the names of the reduced data (algorithm lc, one UINT8 array named lc) under ReducerNamesIndex and register them in the detector's names lookup; returns 0.

Implements Drp::Gpu::ReducerAlgo.

◆ event()

void Drp::Gpu::LcReducer::event ( XtcData::Xtc &  ,
const void *  bufEnd,
unsigned  dataSize 
)
overridevirtual

Set the shape of the lc array to dataSize elements in the data description; the data itself stays on the GPU.

Reimplemented from Drp::Gpu::ReducerAlgo.

◆ hasGraph()

bool Drp::Gpu::LcReducer::hasGraph ( ) const
inlineoverridevirtual

Return true: the compressor is recorded into the Reducer graph.

Implements Drp::Gpu::ReducerAlgo.

◆ payloadSize()

size_t Drp::Gpu::LcReducer::payloadSize ( ) const
inlineoverridevirtual

Return the maximum compressed size reported by the compressor (maxSize()).

Implements Drp::Gpu::ReducerAlgo.

◆ recordGraph()

void Drp::Gpu::LcReducer::recordGraph ( cudaStream_t  stream,
unsigned *const  state_d,
unsigned *const  index_d,
float const *const  calibBuffers_d,
size_t const  calibBufsCnt,
uint8_t *const  dataBuffers_d,
size_t const  dataBufsCnt 
)
overridevirtual

Let the compressor record its kernels into the captured stream (LC_framework::Compressor::updateGraph()) for the state, index, calibrated and data buffers, with buffer sizes given in bytes.

Implements Drp::Gpu::ReducerAlgo.

◆ reduce()

void Drp::Gpu::LcReducer::reduce ( cudaGraphExec_t  ,
cudaStream_t  ,
unsigned  index,
size_t *  dataSize,
unsigned *  retCode 
)
overridevirtual

Launch graph on stream and queue an asynchronous copy of the reduced size, stored just before data buffer index, to *dataSize; *retCode is set to 0.

Implements Drp::Gpu::ReducerAlgo.


The documentation for this class was generated from the following file: