tiny.simd.AlignedArray
Defined in aligned.
Source
Source: lib/simd/src/aligned.zig:345
zig
pub fn Array(comptime T: type, comptime axes: usize) type { return struct { layout: Layout(axes), allocation: Allocation(T), const Self = @This(); pub fn init( allocator: std.mem.Allocator, shape_value: [axes]usize, ) Error!Self { return initFor(allocator, shape_value, native_vector_bytes); } pub fn initFor( allocator: std.mem.Allocator, shape_value: [axes]usize, vector_bytes: usize, ) Error!Self { const layout = try Layout(axes).initFor(shape_value, vector_bytes); _ = try layout.memoryBytes(T); const allocation = try Allocation(T).init(allocator, layout.memoryLen()); @memset(allocation.values, std.mem.zeroes(T)); return .{ .layout = layout, .allocation = allocation, }; } pub fn deinit(self: *Self, allocator: std.mem.Allocator) void { self.allocation.deinit(allocator); self.* = undefined; } pub fn row(self: *Self, indices: [axes - 1]usize) Error![]T { const offset = try self.layout.rowOffset(indices); return self.allocation.values[offset..][0..self.layout.rowLen()]; } pub fn constRow( self: *const Self, indices: [axes - 1]usize, ) Error![]const T { const offset = try self.layout.rowOffset(indices); return self.allocation.values[offset..][0..self.layout.rowLen()]; } pub fn shape(self: *const Self) [axes]usize { return self.layout.shape(); } pub fn memoryShape(self: *const Self) [axes]usize { return self.layout.memoryShape(); } pub fn len(self: *const Self) usize { return self.layout.len(); } pub fn memoryLen(self: *const Self) usize { return self.layout.memoryLen(); } pub fn data(self: *Self) []T { return self.allocation.values; } pub fn constData(self: *const Self) []const T { return self.allocation.values; } pub fn truncate(self: *Self, new_shape: [axes]usize) Error!void { try self.layout.truncate(new_shape); } };}Source: lib/simd/src/root.zig:253
zig
pub const AlignedArray = aligned.Array;Complete caller list
7 direct callers.
lib.simd.src.aligned.checkArrayInitFailures[function] — private source atlib/simd/src/aligned.zig:451in nearest public ownertiny.simd.alignedlib.simd.src.aligned.test_Highway_aligned_array_rows_retain_native_vector_alignment[function] — test source atlib/simd/src/aligned.zig:567in nearest public ownertiny.simd.alignedlib.simd.src.aligned.test_Highway_aligned_array_truncation_preserves_memory_layout_and_values[function] — test source atlib/simd/src/aligned.zig:580in nearest public ownertiny.simd.alignedlib.simd.src.aligned.test_Highway_aligned_arrays_zero_rows_and_retain_padded_geometry[function] — test source atlib/simd/src/aligned.zig:527in nearest public ownertiny.simd.alignedlib.simd.src.aligned.test_pinned_Highway_aligned_array_oracle_matches_dispatched_geometry[function] — test source atlib/simd/src/aligned.zig:545in nearest public ownertiny.simd.alignedlib.smt.src.smtlib.test.test_SMT-LIB_parser_rereads_bit-vector_array_select_store_terms[function] — test source atlib/smt/src/smtlib/test.zig:262in nearest public ownerlib.smt.src.smtlib.testtiny.smt.Sort.write[method] atlib/smt/src/term.zig:69
Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |