Last updated: 2026-11-17

Inference Runtime

Vadd

All API Sections

T-CPU element-wise vector addition implementation.

Computes: output[i] = a[i] + b[i]

2 exports shown

struct

Params

#
pub const Params = struct

Memory Layout

Size: 48 bytes (alignment: 8)

Offset Size Align Field Type
0 16 8 a []const f32
16 16 8 b []const f32
32 16 8 output []f32

Inputs and outputs for one element-wise vector addition.

Parameters

a
First operand vector.
b
Second operand vector of length `>= a.len`.
output
Destination vector of length `>= a.len`.

src/zinc_rt/isa/cpu_zig/vadd.zig:10

function

run

#
pub fn run(params: Params) !void

Compute `output[i] = a[i] + b[i]` for the first `a.len` elements.

Trailing elements of `b` and `output` are ignored, so callers may pass over-sized buffers. is shorter than `a`, otherwise void.

Parameters

params
Operand and destination slices; see `Params`.

Returns

`error.EmptyInput` when `a` is empty, `error.ShapeMismatch` when `output` or `b`

src/zinc_rt/isa/cpu_zig/vadd.zig:21