cub::MergePath#

template<typename KeyIt1, typename KeyIt2, typename OffsetT, typename BinaryPred>
OffsetT cub::MergePath(
KeyIt1 keys1,
KeyIt2 keys2,
OffsetT keys1_count,
OffsetT keys2_count,
OffsetT diag,
BinaryPred binary_pred,
)#

Computes the intersection of the diagonal diag with the merge path in the merge matrix of two input sequences.

This implements the DiagonalIntersection algorithm from Merge-Path. Additional details can be found in:

  • S. Odeh, O. Green, Z. Mwassi, O. Shmueli, Y. Birk, “Merge Path - Parallel Merging Made Simple”, Multithreaded Architectures and Applications (MTAAP) Workshop, IEEE 26th International Parallel & Distributed Processing Symposium (IPDPS), 2012

  • S. Odeh, O. Green, Y. Birk, “Merge Path - A Visually Intuitive Approach to Parallel Merging”, 2014, URL: https://arxiv.org/abs/1406.2628

Returns:

The number of elements merged from the first sequence at the intersection of the diagonal with the merge path. The number of elements merged from the second sequence is diag minus the returned value.