Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 88 additions & 87 deletions benchs/bench_cppcontrib_sa_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ static void verifyIndex2LevelDecoder(
// evaluate the error
double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_seq" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_seq\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -261,10 +261,9 @@ static void verifyIndex2LevelDecoder(

// evaluate the error
const double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -324,9 +323,9 @@ static void verifyIndex2LevelDecoder(
// evaluate the error
const double error1 = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel1 << "\t" << error1 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel1
<< "\t" << error1 << std::endl;

// kernels: accum 2 points, shared centroids
StopWatch swKernel2;
Expand All @@ -353,9 +352,9 @@ static void verifyIndex2LevelDecoder(
// evaluate the error
const double error2 = getError(n, d, outputFaiss, outputKernel2);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2 << "\t" << error2 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2
<< "\t" << error2 << std::endl;

// kernels: accum 2 points, unique centroids
StopWatch swKernel2u;
Expand Down Expand Up @@ -384,9 +383,9 @@ static void verifyIndex2LevelDecoder(
// evaluate the error
const double error2u = getError(n, d, outputFaiss, outputKernel2u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2u << "\t" << error2u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2u
<< "\t" << error2u << std::endl;

// kernels: accum 3 points, shared centroids
StopWatch swKernel3;
Expand Down Expand Up @@ -418,9 +417,9 @@ static void verifyIndex2LevelDecoder(
// evaluate the error
const double error3 = getError(n, d, outputFaiss, outputKernel3);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3 << "\t" << error3 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3
<< "\t" << error3 << std::endl;

// kernels: accum 3 points, unique centroids
StopWatch swKernel3u;
Expand Down Expand Up @@ -456,9 +455,9 @@ static void verifyIndex2LevelDecoder(
// evaluate the error
const double error3u = getError(n, d, outputFaiss, outputKernel3u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3u << "\t" << error3u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3u
<< "\t" << error3u << std::endl;
}
}

Expand Down Expand Up @@ -524,9 +523,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_seq" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_seq\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -573,9 +572,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
const double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -641,9 +640,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
const double error1 = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel1 << "\t" << error1 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel1
<< "\t" << error1 << std::endl;

// kernels: accum 2 points, shared centroids
StopWatch swKernel2;
Expand Down Expand Up @@ -675,9 +674,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
const double error2 = getError(n, d, outputFaiss, outputKernel2);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2 << "\t" << error2 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2
<< "\t" << error2 << std::endl;

// kernels: accum 2 points, unique centroids
StopWatch swKernel2u;
Expand Down Expand Up @@ -711,9 +710,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
const double error2u = getError(n, d, outputFaiss, outputKernel2u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2u << "\t" << error2u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2u
<< "\t" << error2u << std::endl;

// kernels: accum 3 points, shared centroids
StopWatch swKernel3;
Expand Down Expand Up @@ -750,9 +749,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
const double error3 = getError(n, d, outputFaiss, outputKernel3);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3 << "\t" << error3 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3
<< "\t" << error3 << std::endl;

// kernels: accum 3 points, unique centroids
StopWatch swKernel3u;
Expand Down Expand Up @@ -793,9 +792,9 @@ static void verifyMinMaxIndex2LevelDecoder(
// evaluate the error
const double error3u = getError(n, d, outputFaiss, outputKernel3u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3u << "\t" << error3u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3u
<< "\t" << error3u << std::endl;
}
}

Expand Down Expand Up @@ -851,9 +850,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_seq" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_seq\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -899,9 +898,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
const double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -961,9 +960,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
const double error1 = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel1 << "\t" << error1 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel1
<< "\t" << error1 << std::endl;

// kernels: accum 2 points, shared centroids
StopWatch swKernel2;
Expand All @@ -989,9 +988,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
const double error2 = getError(n, d, outputFaiss, outputKernel2);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2 << "\t" << error2 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2
<< "\t" << error2 << std::endl;

// kernels: accum 2 points, unique centroids
StopWatch swKernel2u;
Expand All @@ -1018,9 +1017,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
const double error2u = getError(n, d, outputFaiss, outputKernel2u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2u << "\t" << error2u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2u
<< "\t" << error2u << std::endl;

// kernels: accum 3 points, shared centroids
StopWatch swKernel3;
Expand Down Expand Up @@ -1051,9 +1050,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
const double error3 = getError(n, d, outputFaiss, outputKernel3);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3 << "\t" << error3 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3
<< "\t" << error3 << std::endl;

// kernels: accum 3 points, unique centroids
StopWatch swKernel3u;
Expand Down Expand Up @@ -1086,9 +1085,9 @@ static void verifyIndexPQDecoder(
// evaluate the error
const double error3u = getError(n, d, outputFaiss, outputKernel3u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3u << "\t" << error3u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3u
<< "\t" << error3u << std::endl;
}
}

Expand Down Expand Up @@ -1149,9 +1148,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_seq" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_seq\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1197,9 +1196,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
const double error = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "store_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel << "\t" << error << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\tstore_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel
<< "\t" << error << std::endl;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1264,9 +1263,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
const double error1 = getError(n, d, outputFaiss, outputKernel1);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel1 << "\t" << error1 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel1
<< "\t" << error1 << std::endl;

// kernels: accum 2 points, shared centroids
StopWatch swKernel2;
Expand Down Expand Up @@ -1297,9 +1296,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
const double error2 = getError(n, d, outputFaiss, outputKernel2);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2 << "\t" << error2 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2
<< "\t" << error2 << std::endl;

// kernels: accum 2 points, unique centroids
StopWatch swKernel2u;
Expand Down Expand Up @@ -1331,9 +1330,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
const double error2u = getError(n, d, outputFaiss, outputKernel2u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum2u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel2u << "\t" << error2u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum2u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel2u
<< "\t" << error2u << std::endl;

// kernels: accum 3 points, shared centroids
StopWatch swKernel3;
Expand Down Expand Up @@ -1369,9 +1368,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
const double error3 = getError(n, d, outputFaiss, outputKernel3);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3 << "\t" << error3 << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3
<< "\t" << error3 << std::endl;

// kernels: accum 3 points, unique centroids
StopWatch swKernel3u;
Expand Down Expand Up @@ -1409,9 +1408,9 @@ static void verifyMinMaxIndexPQDecoder(
// evaluate the error
const double error3u = getError(n, d, outputFaiss, outputKernel3u);

std::cout << description << "\t" << n << "\t" << d << "\t"
<< "accum3u_rnd" << "\t" << nIterations << "\t" << timeFaiss
<< "\t" << timeKernel3u << "\t" << error3u << std::endl;
std::cout << description << "\t" << n << "\t" << d << "\taccum3u_rnd\t"
<< nIterations << "\t" << timeFaiss << "\t" << timeKernel3u
<< "\t" << error3u << std::endl;
}
}

Expand Down Expand Up @@ -1484,8 +1483,10 @@ int main(int argc, char** argv) {
(N_ITERATIONS % 6) == 0, "Number of iterations should be 6*x");

// print the header
std::cout << "Codec\t" << "n\t" << "d\t" << "Experiment\t" << "Iterations\t"
<< "Faiss time\t" << "SADecodeKernel time\t" << "Error"
auto delim = "\t";
std::cout << "Codec" << delim << "n" << delim << "d" << delim
<< "Experiment" << delim << "Iterations" << delim << "Faiss time"
<< delim << "SADecodeKernel time" << delim << "Error"
<< std::endl;

// The following experiment types are available:
Expand Down