0
Fork 0
mirror of https://github.com/zml/zml.git synced 2026-11-16 19:11:09 +00:00
zml/stdx/meta.zig
Guillaume Wenzek e5c152c9f6
zml: add an arena to the CompilationContext (#130)
* add an arena to the CompilationContext

There was already an allocator in the CompilationContext, this PR makes
it into an arena and expose the arena allocator.
This allows ops that need to allocate to do so without abusing
`std.BoundedArray` with arbitrary bounds, and in a safe way.
For now little ops use it, which I believe should stay the case, because
most of the time you want to know how many tensor you're working with.
It'll also simplify the life of Zig new-comers

this include some **breaking changes** to `chunkAllowTrailing` and
`split` that are allocating

* upgrade a few `axis_: i64` into `axis_: anytype` to handle tags

* add a few TODO for the next version of the Tensor API

---------

Signed-off-by: Guillaume Wenzek <wzk@zml.ai>
2024-12-11 13:38:55 +01:00

186 lines
5.7 KiB