Skip to content
Open
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
11 changes: 7 additions & 4 deletions diskann-disk/src/utils/math_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use std::{cmp::Ordering, collections::BinaryHeap};

use diskann::{ANNError, ANNResult};
use diskann::{ANNError, ANNErrorKind, ANNResult};
use diskann_linalg::{self, Transpose};
use diskann_providers::{
forward_threadpool,
Expand Down Expand Up @@ -172,7 +172,8 @@ pub fn compute_closest_centers_in_block(
&ones_a,
None, // Initialize the destination matrix
dist_matrix,
);
)
.map_err(|e| ANNError::new(ANNErrorKind::IndexError, e))?;

diskann_linalg::sgemm(
Transpose::None,
Expand All @@ -185,7 +186,8 @@ pub fn compute_closest_centers_in_block(
centers_l2sq,
Some(1.0), // Add to the destination matrix
dist_matrix,
);
)
.map_err(|e| ANNError::new(ANNErrorKind::IndexError, e))?;

diskann_linalg::sgemm(
Transpose::None,
Expand All @@ -198,7 +200,8 @@ pub fn compute_closest_centers_in_block(
centers,
Some(1.0), // Add to the destination matrix.
dist_matrix,
);
)
.map_err(|e| ANNError::new(ANNErrorKind::IndexError, e))?;

if k == 1 {
center_index
Expand Down
Loading
Loading