1 #ifndef FELIX_REORDER_HH_ 2 #define FELIX_REORDER_HH_ 13 #include <immintrin.h> 71 m_num_blocks_per_frame * (m_coldata_header_size + m_num_ch_per_block * 2);
74 static bool do_reorder(uint8_t* dst,
const uint8_t* src,
75 const unsigned& num_frames,
76 unsigned* num_faulty) noexcept;
78 const unsigned& num_frames,
79 unsigned* num_faulty) noexcept;
81 const unsigned& num_frames,
82 unsigned* num_faulty) noexcept;
85 const unsigned frames_start,
86 const unsigned frames_stop,
87 const unsigned& num_frames,
88 unsigned* num_faulty) noexcept;
90 const unsigned frames_start,
91 const unsigned frames_stop,
92 const unsigned& num_frames,
93 unsigned* num_faulty) noexcept;
95 const unsigned frames_start,
96 const unsigned frames_stop,
97 const unsigned& num_frames,
98 unsigned* num_faulty) noexcept;
101 unsigned num_faulty) {
102 return m_num_bytes_per_data * num_frames +
106 (num_frames + 7) / 8;
112 static const bool avx_available =
false;
115 #ifdef __AVX512__REMOVE_ME_AFTER_GCC_PATCH 118 static const bool avx512_available =
false;
128 static void copy_headers(uint8_t* dst,
const uint8_t* src);
130 const unsigned frame_index,
131 const unsigned& num_frames,
unsigned* num_faulty);
135 const unsigned frames_start,
136 const unsigned frames_stop,
137 const unsigned& num_frames,
138 unsigned* num_faulty);
142 static void reorder_avx_handle_four_segments(
const uint8_t* src, uint8_t* dst,
143 const unsigned& num_frames);
144 static void reorder_avx_handle_block(
const uint8_t* src, uint8_t* dst,
145 const unsigned& num_frames);
146 static void reorder_avx_handle_frame(
const uint8_t* src, uint8_t* dst,
148 const unsigned& num_frames,
149 unsigned* num_faulty);
151 #ifdef __AVX512__REMOVE_ME_AFTER_GCC_PATCH 153 static void reorder_avx512_handle_four_frames_two_segments(
154 const uint8_t* src, uint8_t* dst,
const unsigned& num_frames);
155 static void reorder_avx512_handle_four_frames_one_block(
156 const uint8_t* src, uint8_t* dst,
const unsigned& num_frames);
157 static void reorder_avx512_handle_four_frames(
const uint8_t* src,
160 const unsigned& num_frames,
161 unsigned* num_faulty);
static const uint8_t b_adc1_ch3_p0
static const uint8_t b_adc0_ch0_p1
static constexpr size_t m_num_bytes_per_seg
static const unsigned b_seg_0
BIT OFFSET CONSTANTS ///.
static constexpr size_t m_num_bytes_per_frame
Framesize public constants.
static bool do_avx512_reorder(uint8_t *dst, const uint8_t *src, const unsigned &num_frames, unsigned *num_faulty) noexcept
static constexpr size_t m_coldata_header_size
static constexpr size_t m_wib_header_size
static constexpr unsigned m_frame3
static const uint8_t b_adc0_ch0_p0
static constexpr size_t m_num_seg_per_block
static const uint8_t b_adc0_ch2_p1
static const uint8_t b_adc1_ch3_p1
static void copy_headers(uint8_t *dst, const uint8_t *src)
static bool do_reorder_part(uint8_t *dst, const uint8_t *src, const unsigned frames_start, const unsigned frames_stop, const unsigned &num_frames, unsigned *num_faulty) noexcept
static const uint8_t b_adc1_ch1_p1
static const bool avx512_available
static constexpr unsigned m_frame2
static const uint8_t b_adc1_ch2_p0
static constexpr size_t m_num_ch_per_seg
static const uint8_t b_adc1_ch0_p0
static const unsigned b_seg_2
static const bool avx_available
static const uint8_t b_adc0_ch2_p0
static bool do_reorder(uint8_t *dst, const uint8_t *src, const unsigned &num_frames, unsigned *num_faulty) noexcept
METHODS ///.
static const unsigned b_seg_1
static constexpr size_t m_adc_size
static constexpr size_t m_num_bytes_per_reord_seg
static constexpr size_t m_num_ch_per_block
static const uint8_t b_adc0_ch3_p0
static const unsigned b_seg_3
static const uint8_t b_adc0_ch1_p1
static bool do_avx512_reorder_part(uint8_t *dst, const uint8_t *src, const unsigned frames_start, const unsigned frames_stop, const unsigned &num_frames, unsigned *num_faulty) noexcept
static constexpr size_t m_num_blocks_per_frame
SIZE CONSTANTS ///.
static constexpr size_t m_num_ch_per_frame
static bool do_avx_reorder_part(uint8_t *dst, const uint8_t *src, const unsigned frames_start, const unsigned frames_stop, const unsigned &num_frames, unsigned *num_faulty) noexcept
static const uint8_t b_adc0_ch1_p0
static const uint8_t b_adc1_ch0_p1
static bool do_avx_reorder(uint8_t *dst, const uint8_t *src, const unsigned &num_frames, unsigned *num_faulty) noexcept
static constexpr size_t m_num_bytes_per_reord_frame
static const uint8_t b_adc1_ch1_p0
static const uint8_t b_adc0_ch3_p1
static const uint8_t b_adc1_ch2_p1
static constexpr size_t m_num_bytes_per_data
static constexpr size_t m_num_bytes_per_block
static constexpr unsigned m_frame1
static void baseline_handle_frames(uint8_t *dst, const uint8_t *src, const unsigned frames_start, const unsigned frames_stop, const unsigned &num_frames, unsigned *num_faulty)
BASELINE REORDERING ///.
static unsigned calculate_reordered_size(unsigned num_frames, unsigned num_faulty)
static void handle_headers(uint8_t *dst, const uint8_t *src, const unsigned frame_index, const unsigned &num_frames, unsigned *num_faulty)
static constexpr unsigned m_frame0
FRAME OFFSETS ///.