tiny.simd.isSortedBy
Defined in algo.
Source
Source: lib/simd/src/algo.zig:348
zig
pub fn isSortedBy(comptime D: type, input: []const D.Lane, comparator: anytype) bool { if (input.len < 2) return true; const pairs = input.len - 1; var index: usize = 0; while (index + D.lane_count <= pairs) : (index += D.lane_count) { const current = memory.load(D, input[index..]); const next = memory.load(D, input[index + 1 ..]); if (!compare.allFalse(D, comparator.call(D, next, current))) return false; } if (index != pairs) { const remaining = pairs - index; const current = memory.loadN(D, input[index .. input.len - 1], remaining); const next = memory.loadN(D, input[index + 1 ..], remaining); const valid = construct.firstN(D, remaining); if (!compare.allFalse(D, comparator.call(D, next, current) & valid)) return false; } return true;}Source: lib/simd/src/root.zig:470
zig
pub const isSortedBy = algo.isSortedBy;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |