I hereby claim:
- I am Enet4 on github.
- I am e_net4 (https://keybase.io/e_net4) on keybase.
- I have a public key whose fingerprint is B218 D92A A7CF F49A 0342 F859 EA9F 08ED 7359 D0E9
To claim this, I am signing this object:
#[cfg(feature = "gpu")] | |
mod bindings_gpu; | |
#[cfg(feature = "gpu")] | |
pub use bindings_gpu::*; | |
#[cfg(not(feature = "gpu"))] | |
mod bindings; | |
#[cfg(not(feature = "gpu"))] | |
pub use bindings::*; |
#[cfg(feature = "gpu")] | |
const LIBNAME: &str = "gpufaiss_c"; | |
#[cfg(not(feature = "gpu"))] | |
const LIBNAME: &str = "faiss_c"; | |
fn main() { | |
println!("cargo:rustc-link-lib={}", LIBNAME); | |
} |
# Build dynamic library | |
$(CLIBNAME).$(SHAREDEXT): $(LIBCOBJ) ../$(LIBNAME).a | |
$(CXX) $(LDFLAGS) $(FAISSSHAREDFLAGS) -o $@ \ | |
-Wl,--whole-archive $^ $(BLASLDFLAGS) -Wl,--no-whole-archive -static-libstdc++ |
// ------------ in error_c.h ---------------- | |
/** | |
* Get the error message of the last failed operation performed by Faiss. | |
* The given pointer is only valid until another Faiss function is called. | |
*/ | |
const char* faiss_get_last_error(); | |
// ------------ in error_impl.cpp -------------- |
int faiss_Index_search(const FaissIndex* index, idx_t n, const float* x, idx_t k, | |
float* distances, idx_t* labels) { | |
try { | |
reinterpret_cast<const faiss::Index*>(index)->search(n, x, k, distances, labels); | |
} CATCH_AND_HANDLE | |
} |
int faiss_IndexFlat_new_with(FaissIndexFlat** p_index, idx_t d, FaissMetricType metric) { | |
try { | |
IndexFlat* index = new IndexFlat(d, static_cast<faiss::MetricType>(metric)); | |
*p_index = reinterpret_cast<FaissIndexFlat*>(index); | |
return 0; | |
} catch (faiss::FaissException& e) { | |
// ... handle error? | |
return -2; | |
} catch (std::exception& e) { | |
return -4; |
/// Declare an opaque type for a class type `clazz`. | |
#define FAISS_DECLARE_CLASS(clazz) \ | |
typedef struct Faiss ## clazz ## _H Faiss ## clazz; | |
/// Declare an opaque type for a class type `clazz`, while | |
/// actually aliasing it to an existing parent class type `parent`. | |
#define FAISS_DECLARE_CLASS_INHERITED(clazz, parent) \ | |
typedef struct Faiss ## parent ## _H Faiss ## clazz; | |
/// Declare a getter for the field `name` in class `clazz`, |
/// Opaque type for IndexFlat | |
typedef FaissIndex_H FaissIndexFlat; | |
/// Default constructor | |
int faiss_IndexFlat_new(FaissIndexFlat** p_index); | |
/// Constructor with dimensionality and distance metric parameters | |
int faiss_IndexFlat_new_with(FaissIndexFlat** index, idx_t d, FaissMetricType metric); | |
/// attempt a dynamic cast to a flat index |
. | |
├── AutoTune.h | |
├── AuxIndexStructures.h | |
├── Clustering.h | |
├── FaissException.h | |
├── IndexFlat.h | |
├── Index.h | |
├── IndexIVFFlat.h | |
├── IndexIVF.h | |
├── IndexIVFPQ.h |
I hereby claim:
To claim this, I am signing this object: