MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / popcount

Function popcount

test/orb.cpp:93–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static unsigned popcount(unsigned x) {
94 x = x - ((x >> 1) & 0x55555555);
95 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
96 x = (x + (x >> 4)) & 0x0F0F0F0F;
97 x = x + (x >> 8);
98 x = x + (x >> 16);
99 return x & 0x0000003F;
100}
101
102bool compareHamming(int data_size, unsigned* cpu, unsigned* gpu,
103 unsigned thr = 1) {

Callers 1

compareHammingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected