pub trait ComputeView {
type Element;
type Arch: SimdArch;
type Backend;
// Required method
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Top-level trait abstracting over dense, masked, sparse, tiled, and bitboard backends.
Sealed via the SimdArch bound (which requires crate::private::Sealed). All
implementations in this workspace are registered here; external crates cannot
implement ComputeView without also implementing SimdArch (which is sealed).
§Examples
Query the length of a dense SimdView through the ComputeView facade:
use hermes_simd_core::compute::ComputeView;
use hermes_simd_core::view::SimdView;
use hermes_simd_intrinsics::Scalar;
use hermes_simd_core::align::Unaligned;
use hermes_simd_core::execution::Unmasked;
let data = [1.0_f32; 16];
let view: SimdView<'_, f32, Scalar, Unaligned, Unmasked, &[f32]> =
SimdView::new(&data).unwrap();
assert_eq!(view.len(), 16);
assert!(!view.is_empty());Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".