ymd-h/veclib-zig
SIMD based Vector Library for Zig
WARNING This project is still under development.
veclib utilizes Zig standard SIMD vector calculation. Aside from the standard, veclib supports scalar-vector mixed calculation and runtime-known length slice handling.
iota
f(comptime T: type, arg: anytype, out: []T) void
)copy
sqrt
sin
, cos
, tan
exp
, exp2
, exp1m
log
, log2
, log10
, log1p
abs
floor
, ceil
, trunc
, round
byteSwap
, bitReverse
countLeadingZeros
, countTrailingZeros
, popCount
f(comptime T: type, arg1: anytype, arg2: anytype, out: []T) void
)add
, wrapAdd
, saturateAdd
sub
, wrapSub
, saturateSub
mul
, wrapMul
, saturateMul
,div
, divFloor
, divTrunc
, rem
, mod
bitAnd
, bitOr
, bitXor
min
, max
f(comptime T: type, arg1: anytype, arg2: anytype, out: [] bool) void
)eq
, neq
, gt
, gte
, lt
, lte
,f(comptime T: type, arg1: anytype, arg2: anytype, arg3: anytype, out: []T)
)mulAdd
clip
f(comptime T: type, arg: []const T) T
)sum
, wrapSum
, saturateSum
,prod
, wrapProd
, saturateProd
,smallest
, largest
,all
, any
We use anytype
for type inference, however, there some limitations.
arg
at element-wise functions can be scalar or slice.