Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion faiss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ if(WIN32)
target_compile_definitions(faiss_avx512 PRIVATE FAISS_MAIN_LIB)
endif()

target_compile_definitions(faiss PRIVATE FINTEGER=int)
string(FIND "${CMAKE_CXX_FLAGS}" "FINTEGER" finteger_idx)
if (${finteger_idx} EQUAL -1)
target_compile_definitions(faiss PRIVATE FINTEGER=int)
endif()
target_compile_definitions(faiss_avx2 PRIVATE FINTEGER=int)
target_compile_definitions(faiss_avx512 PRIVATE FINTEGER=int)

Expand Down
16 changes: 8 additions & 8 deletions faiss/impl/LocalSearchQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ int dgemm_(

namespace {

void fmat_inverse(float* a, int n) {
int info;
int lwork = n * n;
std::vector<int> ipiv(n);
void fmat_inverse(float* a, FINTEGER n) {
FINTEGER info;
FINTEGER lwork = n * n;
std::vector<FINTEGER> ipiv(n);
std::vector<float> workspace(lwork);

sgetrf_(&n, &n, a, &n, ipiv.data(), &info);
Expand All @@ -123,10 +123,10 @@ void dfvec_add(size_t d, const double* a, const float* b, double* c) {
}
}

void dmat_inverse(double* a, int n) {
int info;
int lwork = n * n;
std::vector<int> ipiv(n);
void dmat_inverse(double* a, FINTEGER n) {
FINTEGER info;
FINTEGER lwork = n * n;
std::vector<FINTEGER> ipiv(n);
std::vector<double> workspace(lwork);

dgetrf_(&n, &n, a, &n, ipiv.data(), &info);
Expand Down