bitonicSort - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
#include "xf_database/bitonic_sort.hpp"
template <
    typename Key_Type,
    int BitonicSortNumber
    >
void bitonicSort (
    hls::stream <Key_Type>& kin_strm,
    hls::stream <bool>& kin_strm_end,
    hls::stream <Key_Type>& kout_strm,
    hls::stream <bool>& kout_strm_end,
    bool order
    )

Bitonic sort is parallel algorithm for sorting.

This algorithms can sort a large vector of data in parallel, and by cascading the sorters into a network it can offer good theoretical throughput.

Although this algorithms is suitable for FPGA acceleration, it does not work well with the row-by-row streaming interface in database library. Please consider this primitive as a demo, and only use it by deriving from this code. Alternative sorting algorithms in this library are insertSort and mergeSort .

Parameters:

Key_Type the input and output key type
BitonicSortNumber the parallel number
kin_strm input key stream
kin_strm_end end flag stream for input key
kout_strm output key stream
kout_strm_end end flag stream for output key
order 1 for ascending or 0 for descending sort