Skip to documentation
SLOP

tiny.simd.AlignedView

Reference tiny.simd AlignedView

Defined in aligned.

Called byCallstest sourcelib.simd.src.alignedtest: aligned owners reject invalid g...alignedLayoutalignedisAlignedalignedView
Static calls · unresolved targets: 1 · external targets: 3.

Source

Source: lib/simd/src/aligned.zig:301

zig
pub fn View(comptime T: type, comptime axes: usize) type {    return struct {        layout: Layout(axes),        storage: []T,        const Self = @This();        pub fn init(storage: []T, shape_value: [axes]usize) Error!Self {            return initFor(storage, shape_value, native_vector_bytes);        }        pub fn initFor(            storage: []T,            shape_value: [axes]usize,            vector_bytes: usize,        ) Error!Self {            if (!isAligned(storage.ptr)) return error.MisalignedStorage;            const layout = try Layout(axes).initFor(shape_value, vector_bytes);            if (storage.len < layout.memoryLen()) return error.StorageTooSmall;            return .{                .layout = layout,                .storage = storage[0..layout.memoryLen()],            };        }        pub fn row(self: *Self, indices: [axes - 1]usize) Error![]T {            const offset = try self.layout.rowOffset(indices);            return self.storage[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.storage[offset..][0..self.layout.rowLen()];        }        pub fn truncate(self: *Self, new_shape: [axes]usize) Error!void {            try self.layout.truncate(new_shape);        }    };}

Source: lib/simd/src/root.zig:252

zig
pub const AlignedView = aligned.View;

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433