katgpucbf.fgpu.recv module

Recv module.

class katgpucbf.fgpu.recv.Chunk(self: spead2._spead2.recv.Chunk, **kwargs)[source]

Bases: Chunk

Collection of heaps passed to the GPU at one time.

It extends the spead2 base class to store a timestamp (computed from the chunk ID when the chunk is received), and optionally store a vkgdr device array.

When used as a context manager, it will call recycle() on exit.

device: object
recycle() None[source]

Return the chunk to the owning stream/group.

sink: ReferenceType
timestamp: int
class katgpucbf.fgpu.recv.Layout(sample_bits: int, heap_samples: int, chunk_samples: int, mask_timestamp: bool)[source]

Bases: BaseLayout

Parameters controlling the sizes of heaps and chunks.

property chunk_heaps: int

Number of heaps per chunk, on time axis.

chunk_samples: int
property heap_bytes: int

Number of payload bytes per heap.

heap_samples: int
mask_timestamp: bool
sample_bits: int
property timestamp_mask: uint64

Mask to AND with incoming timestamps.

async katgpucbf.fgpu.recv.iter_chunks(ringbuffer: ChunkRingbuffer, layout: Layout, sensors: SensorSet, time_converter: TimeConverter) AsyncGenerator[Chunk, None][source]

Iterate over the chunks and update sensors.

It also populates the chunk timestamp.

Parameters:
  • ringbuffer – Source of chunks.

  • layout – Structure of the streams.

  • sensors – Sensor set containing at least the sensors created by make_sensors().

  • time_converter – Converter to turn data timestamps into sensor timestamps.