Class HeapLayout
Defined in File HeapLayout.h
Nested Relationships
Nested Types
Class Documentation
-
class HeapLayout
Stores the offsets and sizes of data, weights, and scales in heaps of packets.
Data and weights are stored in separate heaps in blocks of shared memory or data from file
Public Functions
-
HeapLayout() = default
Construct a new HeapLayout object.
-
~HeapLayout() = default
Destroy the HeapLayout object.
-
void configure(const ska::pst::common::AsciiHeader &data_config, const ska::pst::common::AsciiHeader &weights_config)
Configure a HeapLayout from the AsciiHeader from the data and weights streams.
Both data_config and weights_config must satisfy all of the preconditions defined by the HeapLayout::PacketLayout constructor.
Optionally, either data_config or weights_config may specify the RESOLUTION. If RESOLUTION is specified, then it is verified (if it is inconsistent, an exception is thrown).
- Parameters
data_config – AsciiHeader containing the configuration of the data stream
weights_config – AsciiHeader containing the configuration of the weights stream
-
void initialise(ska::pst::common::AsciiHeader &data_config, ska::pst::common::AsciiHeader &weights_config)
Initialise a HeapLayout from the AsciiHeader from the data and weights streams.
After calling HeapLayout::configure:
the RESOLUTION parameters of both data_config and weights_config are initialised
the PACKET_WEIGHTS_SIZE and PACKET_SCALES_SIZE parameters of weights_config are initialised
- Parameters
data_config – AsciiHeader containing the configuration of the data stream
weights_config – AsciiHeader containing the configuration of the weights stream
-
inline auto get_packet_layout() const -> const PacketLayout&
Get the layout of each packet in the heap.
- Returns
PacketLayout layout of each packet in the heap
-
inline auto get_packet_layout_ptr() const -> const std::shared_ptr<PacketLayout>&
Get the pointer to the layout of each packet in the heap.
- Returns
PacketLayout pointer to the layout of each packet in the heap
-
inline auto get_packets_per_heap() const -> unsigned
Get the number of packets in each heap.
- Returns
unsigned number of packets in each heap
-
inline auto get_data_packet_stride() const -> unsigned
Get the number of bytes in each packet of data stream.
- Returns
unsigned number of bytes in each packet of data stream
-
inline auto get_data_heap_stride() const -> unsigned
Get the number of bytes in each heap of data stream.
- Returns
unsigned number of bytes in heap packet of data stream
-
inline auto get_weights_packet_stride() const -> unsigned
Get the number of bytes in each packet of weights stream.
- Returns
unsigned number of bytes in each packet of weights stream
-
inline auto get_weights_heap_stride() const -> unsigned
Get the number of bytes in each heap of weights stream.
- Returns
unsigned number of bytes in heap packet of weights stream
Protected Attributes
-
std::shared_ptr<common::PacketLayout> packet_layout
The layout of each packet in the heap.
-
uint32_t packets_per_heap = {0}
Number of packets per heap in the data stream.
-
uint32_t data_packet_stride = {0}
Number of bytes per packet in the data stream.
-
uint32_t weights_packet_stride = {0}
Number of bytes per packet in the weights stream.
-
uint32_t data_heap_stride = {0}
Number of bytes per heap in the data stream.
-
uint32_t weights_heap_stride = {0}
Number of bytes per heap in the weights stream.
-
class PacketLayout : public ska::pst::common::PacketLayout
Stores the offsets and sizes of data, weights, and scales of each packet in a heap.
Data and weights are stored in separate heaps in blocks of shared memory or data from file
Public Functions
-
PacketLayout(const ska::pst::common::AsciiHeader &data_config, const ska::pst::common::AsciiHeader &weights_config)
Configure a HeapLayout::PacketLayout from the AsciiHeader of the data and weights streams.
Both data_config and weights_config must specify the following attributes: NCHAN NPOL NDIM NBIT UDP_NSAMP UDP_NCHAN WT_NSAMP
Optionally, the weights_config may also specify PACKET_SCALES_SIZE PACKET_WEIGHTS_SIZE
If PACKET_SCALES_SIZE is specified, then it overrides the assumed default. If PACKET_WEIGHTS_SIZE is specified, then it is verified (if it is inconsistent, an exception is thrown).
- Parameters
data_config – AsciiHeader containing the configuration of the data stream
weights_config – AsciiHeader containing the configuration of the weights stream
-
PacketLayout(const ska::pst::common::AsciiHeader &data_config, const ska::pst::common::AsciiHeader &weights_config)
-
HeapLayout() = default