Ivorforce / NumDot

Tensor math and scientific computation for the Godot game engine.
https://numdot.readthedocs.io
MIT License
17 stars 7 forks source link

Add an option to fix array layout type #89

Open Ivorforce opened 4 weeks ago

Ivorforce commented 4 weeks ago

Currently, we compile strided views with the dynamic layout.

(see documentation)

The only function affected by this is transpose: It changes the runtime layout type to dynamic (or row-major or minor if the strides happen to allow), and the static layout is dynamic. We could support a static fixed layout by changing transpose functions to copy instead of view. This could be documented, along with the performance and binary size improvements this option brings.

Additionally, we should check that all our uses of layout_type::dynamic actually are dynamic (hint: they aren't).

Ivorforce commented 4 weeks ago

I checked the layout types, and there was indeed an error where all arrays defaulted to dynamic layout. This is now fixed, though the performance gains are marginal at best.