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
10 changes: 9 additions & 1 deletion tests/test_disable_pq_sdc_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
pthread_mutex_t temp_file_mutex = PTHREAD_MUTEX_INITIALIZER;

TEST(IO, TestReadHNSWPQ_whenSDCDisabledFlagPassed_thenDisableSDCTable) {
Tempfilename index_filename(&temp_file_mutex, "/tmp/faiss_TestReadHNSWPQ");
// Create a temp file name with a randomized component for stress runs
std::random_device rd;
std::mt19937 mt(rd());
std::uniform_real_distribution<float> dist(0, 9999999);
std::string temp_file_name =
"/tmp/faiss_TestReadHNSWPQ" + std::to_string(int(dist(mt)));
Tempfilename index_filename(&temp_file_mutex, temp_file_name);

// Create a HNSW index with PQ encoding
int d = 32, n = 256;
std::default_random_engine rng(123);
std::uniform_real_distribution<float> u(0, 100);
Expand Down