tiny.simd.NextWithSkip
Defined in autotune.
Source
Source: lib/simd/src/autotune.zig:193
zig
pub fn NextWithSkip(comptime capacity: usize) type { comptime { if (capacity == 0) @compileError("NextWithSkip requires positive capacity"); if (capacity >= Link.max_count) { @compileError("NextWithSkip capacity exceeds packed index range"); } } return struct { links: [capacity]Link = @splat(.{}), count: usize = 0, const Self = @This(); pub fn init(count: usize) Self { std.debug.assert(count != 0); std.debug.assert(count <= capacity); var self = Self{}; self.count = count; for (self.links[0..count], 0..) |*link, position| { link.* = Link.init(position, count); } return self; } pub fn next(self: *const Self, position: usize) usize { std.debug.assert(position < self.count); std.debug.assert(!self.links[position].isRemoved()); return self.links[position].next(); } pub fn skip(self: *Self, position: usize) void { std.debug.assert(position < self.count); std.debug.assert(!self.links[position].isRemoved()); const previous = self.links[position].previous(); const next_position = self.links[position].next(); if (previous == position or next_position == position) return; self.links[next_position].setPrevious(previous); self.links[previous].setNext(next_position); self.links[position].remove(); } };}Source: lib/simd/src/root.zig:562
zig
pub const NextWithSkip = autotune.NextWithSkip;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |