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

Function compareHamming

test/orb.cpp:102–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102bool compareHamming(int data_size, unsigned* cpu, unsigned* gpu,
103 unsigned thr = 1) {
104 bool ret = true;
105 for (int i = 0; i < data_size; i++) {
106 unsigned x = (cpu[i] ^ gpu[i]);
107 if (popcount(x) > thr) {
108 ret = false;
109 cout << endl << "@compareHamming: first mismatch." << endl;
110 cout << "(cpu,gpu,cpu-gpu)[" << i << "] : {" << cpu[i] << ","
111 << gpu[i] << "," << cpu[i] - gpu[i] << "}" << endl;
112 cout << endl;
113 break;
114 }
115 }
116 return ret;
117}
118
119template<typename T>
120class ORB : public ::testing::Test {

Callers 2

orbTestFunction · 0.85
TESTFunction · 0.85

Calls 1

popcountFunction · 0.85

Tested by

no test coverage detected