Skip to content
Open
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
14 changes: 14 additions & 0 deletions rust/lance-linalg/src/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ pub trait SIMD<T: Num + Copy, const N: usize>:
/// Load unaligned data from memory.
///
/// # Safety
///
/// `ptr` must be valid for reads of `N` elements of `T`.
///
/// Most implementations also require a target feature that the build's
/// baseline may not provide, and none of them check for it at runtime:
///
/// - `f32x8`, `f32x16`, `f64x4`, `f64x8` and `i32x8` need AVX on x86_64 and
/// LASX on loongarch64;
/// - `u8x16` needs nothing beyond the baseline on any target.
///
/// Calling one without its feature is undefined behaviour rather than a
/// wrong answer, so either build with the feature enabled, as
/// `.cargo/config.toml` does for `x86_64-unknown-linux-gnu`, or check with
/// `is_x86_feature_detected!` first. See #8872.
unsafe fn load_unaligned(ptr: *const T) -> Self;

/// Store the values to aligned memory.
Expand Down
Loading