14 #include "../../FaissAssert.h"
15 #include "../../Index.h"
16 #include <initializer_list>
21 namespace faiss {
namespace gpu {
27 void setTestSeed(
long seed);
31 float relativeError(
float a,
float b);
34 int randVal(
int a,
int b);
42 T randSelect(std::initializer_list<T> vals) {
43 FAISS_ASSERT(vals.size() > 0);
44 int sel = randVal(0, vals.size());
58 std::vector<float> randVecs(
int num,
int dim);
63 int numQuery,
int dim,
int k,
64 const std::string& configMsg,
65 float maxRelativeError = 6e-5f,
66 float pctMaxDiff1 = 0.1f,
67 float pctMaxDiffN = 0.005f);
70 void compareLists(
const float* refDist,
72 const float* testDist,
75 const std::string& configMsg,
76 bool printBasicStats,
bool printDiffs,
bool assertOnErr,
77 float maxRelativeError = 6e-5f,
78 float pctMaxDiff1 = 0.1f,
79 float pctMaxDiffN = 0.005f);
long idx_t
all indices are this type