Merge pull request 'docs(clawhdf5): document DType variants, fix unresolved doc links' (#17) from sdlc-docs/clawhdf5-types-20260514-165210 into main

This commit is contained in:
redclawsystems
2026-05-14 23:54:48 +00:00
commit 3f222f6956
3030 changed files with 89917 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
//! f16/f32 conversion with SIMD acceleration.
use crate::Backend;
/// Convert a batch of f16 values (as raw u16 bits) to f32.
///
/// Dispatches to the best available SIMD backend.
pub fn f16_to_f32_batch(input: &[u16], output: &mut [f32]) {
assert_eq!(input.len(), output.len());
match crate::detect_backend() {
#[cfg(target_arch = "aarch64")]
Backend::Neon => crate::neon::f16_to_f32_batch(input, output),
#[cfg(target_arch = "x86_64")]
Backend::Avx2 | Backend::Avx512 => {
if is_x86_feature_detected!("f16c") {
// SAFETY: Runtime-verified f16c support.
unsafe { crate::avx2::f16_to_f32_batch(input, output) }
} else {
crate::scalar::f16_to_f32_batch(input, output)
}
}
_ => crate::scalar::f16_to_f32_batch(input, output),
}
}