13 #include "../../FaissAssert.h"
14 #include "../../Index.h"
15 #include <initializer_list>
20 namespace faiss {
namespace gpu {
26 void setTestSeed(
long seed);
30 float relativeError(
float a,
float b);
33 int randVal(
int a,
int b);
41 T randSelect(std::initializer_list<T> vals) {
42 FAISS_ASSERT(vals.size() > 0);
43 int sel = randVal(0, vals.size());
57 std::vector<float> randVecs(
size_t num,
size_t dim);
62 int numQuery,
int dim,
int k,
63 const std::string& configMsg,
64 float maxRelativeError = 6e-5f,
65 float pctMaxDiff1 = 0.1f,
66 float pctMaxDiffN = 0.005f);
69 void compareLists(
const float* refDist,
71 const float* testDist,
74 const std::string& configMsg,
75 bool printBasicStats,
bool printDiffs,
bool assertOnErr,
76 float maxRelativeError = 6e-5f,
77 float pctMaxDiff1 = 0.1f,
78 float pctMaxDiffN = 0.005f);
long idx_t
all indices are this type