tiny.simd.countIf
Defined in algo.
Source
Source: lib/simd/src/algo.zig:76
zig
pub fn countIf(comptime D: type, input: []const D.Lane, predicate: anytype) usize { var total: usize = 0; var index: usize = 0; while (index + D.lane_count <= input.len) : (index += D.lane_count) { total += compare.countTrue(D, predicate.call(D, memory.load(D, input[index..]))); } if (index != input.len) { const remaining = input.len - index; const matches = predicate.call(D, memory.loadN(D, input[index..], remaining)); total += compare.countTrue(D, matches & construct.firstN(D, remaining)); } std.debug.assert(total <= input.len); return total;}Source: lib/simd/src/root.zig:458
zig
pub const countIf = algo.countIf;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |