about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/core_simd/src/vector.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs
index eee53385c15..9cefe384264 100644
--- a/crates/core_simd/src/vector.rs
+++ b/crates/core_simd/src/vector.rs
@@ -24,6 +24,14 @@ where
     LaneCount<LANES>: SupportedLaneCount,
     T: SimdElement,
 {
+    /// Number of lanes in this vector.
+    pub const LANES: usize = LANES;
+
+    /// Get the number of lanes in this vector.
+    pub const fn lanes(&self) -> usize {
+        LANES
+    }
+
     /// Construct a SIMD vector by setting all lanes to the given value.
     pub const fn splat(value: T) -> Self {
         Self([value; LANES])