Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketkedia committed Dec 4, 2024
1 parent d86ff58 commit 08bcd82
Show file tree
Hide file tree
Showing 2 changed files with 383 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/index/src/hnsw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl Index<HnswIndexConfig> for HnswIndex {

fn get_all_ids_sizes(&self) -> Result<Vec<usize>, Box<dyn ChromaError>> {
let mut sizes = vec![0usize; 2];
unsafe { get_all_ids_size(self.ffi_ptr, sizes.as_mut_ptr()) };
unsafe { get_all_ids_sizes(self.ffi_ptr, sizes.as_mut_ptr()) };
read_and_return_hnsw_error(self.ffi_ptr)?;
Ok(sizes)
}
Expand Down Expand Up @@ -381,7 +381,7 @@ extern "C" {
fn add_item(index: *const IndexPtrFFI, data: *const f32, id: usize, replace_deleted: bool);
fn mark_deleted(index: *const IndexPtrFFI, id: usize);
fn get_item(index: *const IndexPtrFFI, id: usize, data: *mut f32);
fn get_all_ids_size(index: *const IndexPtrFFI, sizes: *mut usize);
fn get_all_ids_sizes(index: *const IndexPtrFFI, sizes: *mut usize);
fn get_all_ids(index: *const IndexPtrFFI, non_deleted_ids: *mut usize, deleted_ids: *mut usize);
fn knn_query(
index: *const IndexPtrFFI,
Expand Down
Loading

0 comments on commit 08bcd82

Please sign in to comment.