Skip to content

Commit df9e2c4

Browse files
Fix a placeholder for 'unimplemented' in mapped_io.cpp (facebookresearch#4268)
Summary: This should fix a problem on macos compilation (just compilation), as discussed in facebookresearch#4250 (comment) mnorris11 please verify Pull Request resolved: facebookresearch#4268 Reviewed By: junjieqi Differential Revision: D72215145 Pulled By: mnorris11 fbshipit-source-id: ccac8aedacaef330dbdc18888d16f870d008df0f
1 parent 0d3aff9 commit df9e2c4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

faiss/impl/mapped_io.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,15 @@ struct MmappedFileMappingOwner::PImpl {
227227
#else
228228

229229
struct MmappedFileMappingOwner::PImpl {
230-
PImpl(FILE* f) {
231-
FAISS_THROW_FMT("Not implemented");
230+
void* ptr = nullptr;
231+
size_t ptr_size = 0;
232+
233+
PImpl(const std::string& filename) {
234+
FAISS_THROW_MSG("Not implemented");
232235
}
233236

234-
~PImpl() {
235-
FAISS_THROW_FMT("Not implemented");
237+
PImpl(FILE* f) {
238+
FAISS_THROW_MSG("Not implemented");
236239
}
237240
};
238241

tests/test_io.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io
1212
import sys
1313
import pickle
14+
import platform
1415
from multiprocessing.pool import ThreadPool
1516
from common_faiss_tests import get_dataset_2
1617

@@ -485,6 +486,10 @@ def test_reader(self):
485486

486487

487488
class TestIOFlatMMap(unittest.TestCase):
489+
@unittest.skipIf(
490+
platform.system() not in ["Windows", "Linux"],
491+
"supported OSes only"
492+
)
488493
def test_mmap(self):
489494
xt, xb, xq = get_dataset_2(32, 0, 100, 50)
490495
index = faiss.index_factory(32, "SQfp16", faiss.METRIC_L2)

0 commit comments

Comments
 (0)