Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
9 changes: 6 additions & 3 deletions diskann-disk/src/utils/math_util.rs
Original file line number Diff line number Diff line change
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::log_index_error(format_args!("{}", 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::log_index_error(format_args!("{}", e)))?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, you may want to prefer ANNError::new(ANNErrorKind::IndexError, e) instead of the old log* style constructors. The former defers any kind of string formatting until the entire error is formatter higher in the call stack, where-as the latter forces eager string evaluation lower in the callstack. Not that it matters that much though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done + created a task to remove the old log-style constructors: #1003


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::log_index_error(format_args!("{}", e)))?;

if k == 1 {
center_index
Expand Down
Loading
Loading