T-SIMD v31.1.0
A C++ template SIMD library
Loading...
Searching...
No Matches
Sorting

Description

Functions for sorting Vec's.

Functions

template<SortSlope SLOPE, typename T , size_t SIMD_WIDTH>
static void simd::bitonicSort (Vec< T, SIMD_WIDTH > vecs[Vec< T, SIMD_WIDTH >::elems])
 Sorts multiple Vec's independently using the bitonic sort algorithm.
 
template<SortSlope SLOPE, typename T , size_t SIMD_WIDTH>
static void simd::bitonicSortSortedPairs (Vec< T, SIMD_WIDTH > vecs[Vec< T, SIMD_WIDTH >::elems])
 Fuses consecutive pairs of sorted Vec's such that the pair is sorted over the two vectors.
 
template<size_t LENGTH, SortSlope SLOPE, typename T , size_t SIMD_WIDTH>
static void simd::verticalBitonicSort (T data[LENGTH])
 Sorts data vector using vertical version of bitonic sort. Assumes that data size is a power of 2 times the number of elements in a SIMD vector squared; if not, a static assertion is raised. Note: This function has not been subjected to auto-tests.
 

Function Documentation

◆ bitonicSort()

template<SortSlope SLOPE, typename T , size_t SIMD_WIDTH>
static void simd::bitonicSort ( Vec< T, SIMD_WIDTH > vecs[Vec< T, SIMD_WIDTH >::elems])
inlinestatic

Sorts multiple Vec's independently using the bitonic sort algorithm.

Template Parameters
SLOPEdirection to sort in (SortSlope::ASCENDING or SortSlope::DESCENDING)
Parameters
[in,out]vecsarray of Vec's to sort

◆ bitonicSortSortedPairs()

template<SortSlope SLOPE, typename T , size_t SIMD_WIDTH>
static void simd::bitonicSortSortedPairs ( Vec< T, SIMD_WIDTH > vecs[Vec< T, SIMD_WIDTH >::elems])
inlinestatic

Fuses consecutive pairs of sorted Vec's such that the pair is sorted over the two vectors.

Template Parameters
SLOPEdirection to sort in (SortSlope::ASCENDING or SortSlope::DESCENDING)
Parameters
vecsarray of Vec's to sort (Vec's must be sorted individually)

◆ verticalBitonicSort()

template<size_t LENGTH, SortSlope SLOPE, typename T , size_t SIMD_WIDTH>
static void simd::verticalBitonicSort ( T data[LENGTH])
inlinestatic

Sorts data vector using vertical version of bitonic sort. Assumes that data size is a power of 2 times the number of elements in a SIMD vector squared; if not, a static assertion is raised. Note: This function has not been subjected to auto-tests.

Template Parameters
LENGTHlength of data vector
SLOPEdirection to sort in (SortSlope::ASCENDING or SortSlope::DESCENDING)
Parameters
datavector of data (may be unaligned)