| 91 | } |
| 92 | |
| 93 | static 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 | |
| 102 | bool compareHamming(int data_size, unsigned* cpu, unsigned* gpu, |
| 103 | unsigned thr = 1) { |