template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::hamming_result_t>
status_t hamming(
in_type_ const *a,
in_type_ const *b,
std::size_t d,
result_type_ *r,
nk_capability_t capabilities = default_capabilities(),
nk_stream_t stream = nullptr) noexcept; template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::hamming_result_t, vector_of<in_type_> a_type_, vector_of<in_type_> b_type_>
expected<result_type_> hamming(
a_type_ const & a,
b_type_ const & b,
nk_capability_t capabilities = default_capabilities()) noexcept; Hamming distance between two bit runs of equal dimensions; unexpected_dimensions_k when they differ or either run is strided or ends mid-value.
Parameters
a | in | First input vector |
|---|---|---|
b | in | Second input vector |
d | in | Counts dimensions, a multiple of the values per byte. |
r | out | Pointer to output 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 |