Skip to documentation
SLOP

tiny.simd.AlignedArray

Reference tiny.simd AlignedArray

Defined in aligned.

Called byCallsprivate sourcelib.simd.src.alignedcheckArrayInitFailurestest sourcelib.simd.src.alignedtest: Highway aligned array rows reta...test sourcelib.simd.src.alignedtest: Highway aligned array truncatio...test sourcelib.simd.src.alignedtest: Highway aligned arrays zero row...test sourcelib.simd.src.alignedtest: pinned Highway aligned array or...+2 morealignedAllocationalignedLayoutalignedArray
Static calls · unresolved targets: 1 · external targets: 9.

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.

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433