Overview
Computes the population count (popcnt), or Hamming distance of a binary string. This kernel takes in a single unsigned 32-bit value and returns the count of 1's that the value contains.
Dispatcher Prototype
void volk_32u_popcnt(uint32_t* ret, const uint32_t value)
Inputs
Outputs
- ret: The return value containing the popcnt.
Example
int N = 10;
uint32_t bitstring = 0x55555555;
uint32_t hamming_distance = 0;
volk_32u_popcnt(&hamming_distance, bitstring);
printf("hamming distance of %x = %i\n", bitstring, hamming_distance);
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90