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
2 changes: 1 addition & 1 deletion rust/lance-linalg/src/distance/hamming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ unsafe fn hamming_batch_avx512(query: u64, targets: &[u64], results: &mut [u32])
}
}

/// AVX2 popcount using lookup table (Harley-Seal / PSHUFB method).
/// AVX2 popcount via a PSHUFB nibble-lookup table.
///
/// The chunk loop reaches only the first `targets.len() / 4 * 4` slots through a
/// raw pointer, 4 x u32 per chunk with no bounds check; the trailing slots go
Expand Down
10 changes: 10 additions & 0 deletions rust/lance-linalg/src/simd/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ fn gather_scalar_x86(slice: &[f32], indices: &[i32; 8]) -> f32x8 {
}

impl From<&[f32]> for f32x8 {
/// Loads the first 8 elements of `value`.
///
/// # Panics
///
/// Panics if `value` has fewer than 8 elements.
fn from(value: &[f32]) -> Self {
assert!(
value.len() >= 8,
Expand Down Expand Up @@ -532,6 +537,11 @@ impl std::fmt::Debug for f32x16 {
}

impl From<&[f32]> for f32x16 {
/// Loads the first 16 elements of `value`.
///
/// # Panics
///
/// Panics if `value` has fewer than 16 elements.
fn from(value: &[f32]) -> Self {
assert!(
value.len() >= 16,
Expand Down
10 changes: 10 additions & 0 deletions rust/lance-linalg/src/simd/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ impl std::fmt::Debug for f64x4 {
}

impl From<&[f64]> for f64x4 {
/// Loads the first 4 elements of `value`.
///
/// # Panics
///
/// Panics if `value` has fewer than 4 elements.
fn from(value: &[f64]) -> Self {
assert!(
value.len() >= 4,
Expand Down Expand Up @@ -393,6 +398,11 @@ impl std::fmt::Debug for f64x8 {
}

impl From<&[f64]> for f64x8 {
/// Loads the first 8 elements of `value`.
///
/// # Panics
///
/// Panics if `value` has fewer than 8 elements.
fn from(value: &[f64]) -> Self {
assert!(
value.len() >= 8,
Expand Down
5 changes: 5 additions & 0 deletions rust/lance-linalg/src/simd/i32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ impl std::fmt::Debug for i32x8 {
}

impl From<&[i32]> for i32x8 {
/// Loads the first 8 elements of `value`.
///
/// # Panics
///
/// Panics if `value` has fewer than 8 elements.
fn from(value: &[i32]) -> Self {
assert!(
value.len() >= 8,
Expand Down
5 changes: 5 additions & 0 deletions rust/lance-linalg/src/simd/u8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ impl std::fmt::Debug for u8x16 {
}

impl From<&[u8]> for u8x16 {
/// Loads the first 16 elements of `value`.
///
/// # Panics
///
/// Panics if `value` has fewer than 16 elements.
fn from(value: &[u8]) -> Self {
assert!(
value.len() >= 16,
Expand Down
Loading