Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ymd-h/veclib-zig
SIMD based Vector Library for Zig
https://github.com/ymd-h/veclib-zig
simd zig
Last synced: 2 months ago
JSON representation
SIMD based Vector Library for Zig
- Host: GitHub
- URL: https://github.com/ymd-h/veclib-zig
- Owner: ymd-h
- License: mit
- Created: 2024-10-08T14:21:23.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-10-23T10:31:39.000Z (4 months ago)
- Last Synced: 2024-10-28T22:20:26.356Z (4 months ago)
- Topics: simd, zig
- Language: Zig
- Homepage: https://ymd-h.github.io/veclib-zig/
- Size: 188 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# veclib.zig: SIMD based Vector Computing Library
> [!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.## Features
- Nullary Function
- `iota`
- Element-wise Unary Function (`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`
- Element-wise Binary Function (`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`
- Element-wise Binary Comparison (`f(comptime T: type, arg1: anytype, arg2: anytype, out: [] bool) void`)
- `eq`, `neq`, `gt`, `gte`, `lt`, `lte`,
- Ternary Function (`f(comptime T: type, arg1: anytype, arg2: anytype, arg3: anytype, out: []T)`)
- `mulAdd`
- `clip`
- Reduction Function (`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.
- scalar value will be broadcsted (not to slice size, but to SIMD vector size)
- Not all types are supported at some functions.
- e.g. Bit-wise operations are only supported for integer types.