Summary of the Operations#
Basics#
- transformapplies a function to each element of the sequence, equivalent to the functional operation- map
- selecttakes the first N` elements of the sequence satisfying a condition (via a selection mask or a predicate function)
- uniquereturns unique elements within a sequence
- histogramgenerates a summary of the statistical distribution of the sequence
Aggregation#
- reducetraverses the sequence while accumulating some data, equivalent to the functional operation- fold_left
- scanis the cumulative version of- reducewhich returns the sequence of the intermediate values taken by the accumulator
Differentiation#
- adjacent_differencecomputes the difference between the current element and the previous or next one in the sequence
- discontinuitydetects value change between the current element and the previous or next one in the sequence
Rearrangement#
- sortrearranges the sequence by sorting it. It could be according to a comparison operator or a value using a radix approach
- partial_sortrearranges the sequence by sorting it up to and including a given index, according to a comparison operator.
- nth_elementplaces the nth element in its sorted position, with elements less-than before, and greater after, according to a comparison operator.
- exchangerearranges the elements according to a different stride configuration which is equivalent to a tensor axis transposition
- shufflerotates the elements
Partition/Merge#
- partitiondivides the sequence into two or more sequences according to a predicate while preserving some ordering properties
- mergemerges two ordered sequences into one while preserving the order
Data Movement#
- storestores the sequence to a continuous memory zone. There are variations to use an optimized path or to specify how to store the sequence to better fit the access patterns of the CUs.
- loadthe complementary operations of the above ones.
- memcpycopies bytes between device sources and destinations
Sequence Search#
- find_first_ofsearches for the first occurrence of any of the provided elements.
- adjacent_findsearches a given sequence for the first occurence of two consecutive equal elements.
- searchsearches for the first occurrence of the sequence.
- search_nsearches for the first occurrence of a sequence of count elements all equal to value.
- find_endsearches for the last occurrence of the sequence.
Other operations#
- run_length_encodegenerates a compact representation of a sequence
- binary_searchfinds for each element the index of an element with the same value in another sequence (which has to be sorted)
- configselects a kernel’s grid/block dimensions to tune the operation to a GPU