|
| | MemPoolGpu (Parameters ¶) |
| | Read the dmaBufSize (rounded up to a multiple of 64 kB, default 64 kB), dmaBufCount (power of 2, default 4) and gpuId kwargs, set up the CUDA context and check the required device attributes.
|
| |
| virtual | ~MemPoolGpu () |
| | Release the driver's GPU memory registration, then free the DMA buffers and the host write, calibration and reduce buffers.
|
| |
| int | initialize (Parameters ¶) |
| | Declared but not defined in MemPool.cc.
|
| |
| int | fd () const override |
| | Return the file descriptor of the device panel's DataDev.
|
| |
| int | setMaskBytes (uint8_t laneMask, unsigned virtChan) override |
| | Set the driver DMA mask to the destinations (dmaDest of lane and virtChan) of the lanes in laneMask; once a call has succeeded, later calls only log that the earlier setting is in effect.
|
| |
| const CudaContext & | context () const |
| | Return the CUDA context.
|
| |
| const std::shared_ptr< DetPanel > | panel () const |
| | Return the device panel.
|
| |
| void | createHostBuffers (size_t size) |
| | Allocate nbuffers() zeroed pinned host buffers of size bytes each, for the DMA descriptors, TimingHeaders and TEB input data (per the code comment).
|
| |
| void | destroyHostBuffers () |
| | Free the host write buffers if they exist.
|
| |
| void | createCalibBuffers (unsigned nElements) |
| | Allocate nbuffers() zeroed device buffers of nElements floats each for calibrated data.
|
| |
| void | destroyCalibBuffers () |
| | Free the calibration buffers if they exist.
|
| |
| void | createReduceBuffers (size_t nBytes, size_t reserved) |
| | Allocate nbuffers() zeroed device buffers of reserved plus nBytes bytes each (both rounded up to multiples of 8); the reserved part at the front of each is for the datagram header.
|
| |
| void | destroyReduceBuffers () |
| | Free the reduce buffers if they exist.
|
| |
| const auto & | hostWrtBufs () const |
| | Return the pinned host write buffers: nbuffers() contiguous buffers of hostWrtBufsSize() bytes.
|
| |
| const auto & | calibBuffers_d () const |
| | Return the device calibration buffers: nbuffers() contiguous buffers of calibBufsSize() bytes.
|
| |
| const auto & | reduceBuffers_d () const |
| | Return the device address of the data part of reduce buffer 0; each further buffer starts reduceBufsReserved() plus reduceBufsSize() bytes later.
|
| |
| size_t | hostWrtBufsSize () const |
| | Return the size in bytes of one host write buffer (0 if none).
|
| |
| size_t | calibBufsSize () const |
| | Return the size in bytes of one calibration buffer (0 if none).
|
| |
| size_t | reduceBufsSize () const |
| | Return the size in bytes of the data part of one reduce buffer, without the reserved part (0 if none).
|
| |
| size_t | reduceBufsReserved () const |
| | Return the size in bytes of the reserved header part at the front of each reduce buffer.
|
| |
| int64_t | nPgpInUser () const |
| | Return the driver's count of receive buffers held by the user (dmaGetRxBuffinUserCount()).
|
| |
| int64_t | nPgpInHw () const |
| | Return the driver's count of receive buffers in hardware (dmaGetRxBuffinHwCount()).
|
| |
| int64_t | nPgpInPreHw () const |
| | Return the driver's count of receive buffers in the pre-hardware queue (dmaGetRxBuffinPreHwQCount()).
|
| |
| int64_t | nPgpInRx () const |
| | Return the driver's count of receive buffers in the software queue (dmaGetRxBuffinSwQCount()).
|
| |
| | MemPool (const Parameters ¶) |
| | Create the transition buffer queue (TEB_TR_BUFFERS rounded up to a power of 2) and zero the counters.
|
| |
| virtual | ~MemPool () |
| | Does nothing; empty body.
|
| |
| unsigned | dmaCount () const |
| | Return the number of DMA buffers reported by the driver.
|
| |
| unsigned | nDmaBuffers () const |
| | Return dmaCount() rounded up to a power of 2.
|
| |
| unsigned | dmaSize () const |
| | Return the size of one DMA buffer.
|
| |
| unsigned | nbuffers () const |
| | Return the number of pebble (L1Accept) buffers.
|
| |
| size_t | bufferSize () const |
| | Return the size of one pebble L1Accept buffer.
|
| |
| void | shutdown () |
| | Shut down the transition buffer queue and log how often DMA reads and returns failed.
|
| |
| Pds::EbDgram * | allocateTr () |
| | Pop a free transition buffer as an EbDgram pointer, or return nullptr if none is available.
|
| |
| void | freeTr (Pds::EbDgram *dgram) |
| | Check the overrun sentinels of transition buffer dgram (logging the first overrun), then push it back onto the free queue.
|
| |
| unsigned | allocateDma () |
| | Count one DMA buffer allocation (the firmware does the actual allocation) and return the count before the increment.
|
| |
| ssize_t | readDma (uint32_t count, int32_t *ret, uint32_t *index, uint32_t *flags, uint32_t *errors, uint32_t *dest) |
| | Read up to count DMA buffers with dmaReadBulkIndex() on fd(), filling the per-buffer return sizes, indices, flags, errors and destinations.
|
| |
| ssize_t | freeDma (unsigned count, uint32_t *indices) |
| | Return count DMA buffers (by index) to the driver through the subclass and log errors; on success the frees are counted.
|
| |
| unsigned | allocate () |
| | Allocate the next pebble buffer index in order, blocking while all buffers are in use.
|
| |
| void | freePebble (unsigned) |
| | Free the oldest pebble buffer (logging if the index is not the expected one), wake a blocked allocate() if the pool was full, and check that buffer's overrun sentinels.
|
| |
| void | flushPebble () |
| | Free pebble buffers in order until none is in use.
|
| |
| int64_t | dmaInUse () const |
| | Return the number of DMA allocations minus frees.
|
| |
| int64_t | inUse () const |
| | Return the number of pebble allocations minus frees.
|
| |
| int64_t | trInUse () const |
| | Return guess_size() of the transition buffer queue.
|
| |
| void | resetCounters () |
| | Reset the DMA counters (only if no DMA buffer is in use, otherwise warn), the pebble counters (with a warning if buffers are still in use), the overrun flags and the error counts.
|
| |
| template<typename T > |
| T * | getAs () |
| | Return this pool cast with static_cast to T*.
|
| |
Memory pool of the GPU DRP.
It opens the PGP device, or runs in simulator mode if the device is /dev/null, allocates the DMA buffers on the GPU and gives them to the FPGA. It also manages the pinned host write buffers and the calibration and reduce buffers on the GPU.