Commit Graph

10 Commits (main)

Author SHA1 Message Date
Kaival Parikh a4401c13d8 Allow using custom index readers and writers (#4180)
Summary:
### Description

- Create custom readers and writers for index IO, which take function pointers as input
- Also expose these from the C_API

This is helpful for FFI use, where calling processes would pass upcall stubs for streamlined IO

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4180

Reviewed By: gtwang01

Differential Revision: D71208266

Pulled By: mnorris11

fbshipit-source-id: ab82397d4780a2a07c7bfdc52329968377f42af4
2025-04-01 11:05:29 -07:00
Michael Kosten 2c961cc308 Add VectorTransform read from filename to the C API (#3970)
Summary:
This adds read_VectorTransform to the C API. This is helpful for independently loading a vector transform rather than as an IndexPreTransform.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3970

Reviewed By: asadoughi

Differential Revision: D65192203

Pulled By: junjieqi

fbshipit-source-id: 949ae875924b9f3558d7a9f43c4f2aa8ae705f02
2024-10-30 12:01:15 -07:00
Michael Norris eff0898a13 Enable linting: lint config changes plus arc lint command (#3966)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3966

This actually enables the linting.

Manual changes:
- tools/arcanist/lint/fbsource-licenselint-config.toml
- tools/arcanist/lint/fbsource-lint-engine.toml

Automated changes:
`arc lint --apply-patches --take LICENSELINT --paths-cmd 'hg files faiss'`

Reviewed By: asadoughi

Differential Revision: D64484165

fbshipit-source-id: 4f2f6e953c94ef6ebfea8a5ae035ccfbea65ed04
2024-10-22 09:46:48 -07:00
Michael Norris 56a383f253 Resolve "duplicate-license-header": Find and replace duplicate license headers (#3967)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3967

This diff just finds and replaces duplicate license headers.

See the errors for "duplicate-license-header" in D64429711 under "linter-coverage-verification" signal.

Reviewed By: asadoughi

Differential Revision: D64484123

fbshipit-source-id: 906e8baa3a11a3bbee174a03dcc27681f9fd78c2
2024-10-21 08:26:22 -07:00
Carter McClellan e52101689f Summary: Add Binary Index i.o to c_api (#2233)
Summary:
Add Binary Index i.o to c_api

In reference to isse: https://github.com/facebookresearch/faiss/issues/2225

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2233

Test Plan: Only changes to the C API

Reviewed By: beauby

Differential Revision: D34815076

Pulled By: mdouze

fbshipit-source-id: 70e0bb15ff02044995460c274bd50465b44ccc5b
2022-03-16 03:28:46 -07:00
Lucas Hosseini e86bf8cae1 Enable clang-format + autofix.
Summary: Format whole codebase with clang-format.

Reviewed By: mdouze

Differential Revision: D22891341

fbshipit-source-id: 673032b2444d61026d1e2c3fa2c5659f178cf58b
2021-02-25 04:46:10 -08:00
Prabhat Roy 7a289d5418 Added C API to CMake and CircleCI (#1678)
Summary:
This supersedes https://github.com/facebookresearch/faiss/issues/1390 and https://github.com/facebookresearch/faiss/issues/1141.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1678

Reviewed By: mdouze

Differential Revision: D26428986

Pulled By: beauby

fbshipit-source-id: 1e2718f457c1aca18c19edc2436d6baf9b627a60
2021-02-15 12:41:31 -08:00
Jose Truyol c47da8a948 [C_API] Pass compilation in current state (#989)
* Pass compilation in current state

* Fix formatting and add missing parts

* Define DistanceComputer

* Add documentation to name changed on DistanceComputer::operator()()

* Apply suggestions from code review

Changes in docs

Co-Authored-By: Eduardo Pinho <enet4mikeenet@gmail.com>

* Updated MetricType
2019-11-19 11:36:44 +01:00
Eduardo Pinho 2bfbead8f1 [C API] Update for compatibility with v1.5 (#858)
* [c_api] Update impl and interface for v1.5

- move IndexShards to dedicated module IndexShards_c.{h|cpp}
- remove getter/setters to unreachable fields
- reimplement faiss_IndexIVF_imbalance_factor (to use invlists)
- minor IndexIVF documentation tweaks
- Remove QueryResult, provide RangeQueryResult

* [c_api] Document FaissErrorCode

* [c_api] Update GPU impl and interface for v1.5

- Remove unavailable method setTempMemoryFraction

* [c_api] Relicense to MIT

In accordance to the rest of the project
2019-06-12 15:46:08 +02:00
Eduardo Pinho 9efdd8d427 [C API] Additional API coverage: IndexLSH, I/O, meta-indexes (#425)
* [c_api] leverage index downcast

- make index downcast declaration+definition possible with macros
- use macros on existing index types

* [c_api] Add IndexLSH to C API

* [c_api] Add Index IO interface

- new header index_io_c.h for access to the index_io.h API
- function`faiss_write_index` and overloads for dumping index to a file
- function`faiss_read_index` and overloads for reading index from a file
- function`faiss_clone_index` for cloning an index
- update C example to save index to a file

* [c_api] Add IndexIDMap and IndexShards API
2018-05-02 13:39:59 +02:00