mratsim / Arraymancer

A fast, ergonomic and portable tensor library in Nim with a deep learning focus for CPU, GPU and embedded devices via OpenMP, Cuda and OpenCL backends
https://mratsim.github.io/Arraymancer/
Apache License 2.0
1.34k stars 95 forks source link

[Upstream] Cannot switch to Laser-based tensors #412

Open mratsim opened 4 years ago

mratsim commented 4 years ago

Laser-based tensors use either a raw pointer to be able to plug in buffers coming from external libraries (Numpy, PyTorch, Tensorflow) and also exchange buffer with zero-copy. Or they use a seq for Nim ref types or strings.

https://github.com/mratsim/Arraymancer/blob/d3f078a6e577b232e2b1c8973add319f285fdd9e/src/laser/tensor/datatypes.nim#L12-L30

Unfortunately supportsCopyMem doesn't work properly in type section, making Laser Dead On Arrival :/. https://github.com/nim-lang/Nim/issues/13095

mratsim commented 4 years ago

Original issue fixed but now there is a new one it's not a showstopper but always having to put the generic type is annoying and even if Arraymancer is clean, users proc can still trigger it: https://github.com/nim-lang/Nim/issues/13193