Skip to content

Commit 4fbccaf

Browse files
committed
Add lanes()
1 parent afd7c5a commit 4fbccaf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/core_simd/src/vector.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ where
2424
LaneCount<LANES>: SupportedLaneCount,
2525
T: SimdElement,
2626
{
27+
/// Get the number of lanes in this vector.
28+
pub const fn lanes(&self) -> usize {
29+
LANES
30+
}
31+
2732
/// Construct a SIMD vector by setting all lanes to the given value.
2833
pub const fn splat(value: T) -> Self {
2934
Self([value; LANES])

0 commit comments

Comments
 (0)