Lombiq / Hastlayer-SDK

Turning .NET software into FPGA hardware for faster execution and lower power usage.

Home Page:https://hastlayer.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to construct SimpleMemory without copying

Piedone opened this issue · comments

As suggested by @antonfirsov, add an ability to create a SimpleMemory object from existing data (like an image that was read in) in a way that doesn't involve copying to the SimpleMemory.Memory array.

This can be achieved by changing the Memory property to Memory<byte> (see this and this post) for example. Then we can have a SimpleMemory constructor that instantiates an array as before and stores that in the property, and another one that takes a Memory<byte> (or Memory<int> if it's cell-structured) directly. So we'd maintain backwards compatibility, have an option for simple construction, but also enable copy-less usage.

This is done and will be part of the next release.