template <numeric_dtype index_type_>
status_t sparse_intersect(
index_type_ const *a,
index_type_ const *b,
std::size_t a_length,
std::size_t b_length,
index_type_ *result,
std::size_t *count,
nk_capability_t capabilities = default_capabilities(),
nk_stream_t stream = nullptr) noexcept; template <numeric_dtype index_type_, vector_of<index_type_> a_type_, vector_of<index_type_> b_type_>
expected<std::size_t> sparse_intersect(
a_type_ const & a,
b_type_ const & b,
nk_capability_t capabilities = default_capabilities()) noexcept; Counts the indices two sorted index runs share; unexpected_dimensions_k for a strided run or one ending mid-value.
Parameters
a | in | First sorted index array (ascending, unique elements) |
|---|---|---|
b | in | Second sorted index array (ascending, unique elements) |
a_length | in | Number of elements in a |
b_length | in | Number of elements in b |
result | out | Optional buffer for matches, at least min( a_length, b_length) long |
count | out | Output intersection count |
capabilities | in | Capabilities to pick from, or zero for the C++ template |
stream | in | Null on the CPU, or the stream of the device capabilities describes |