sinshu / numflat

A numerical computation library for C#
MIT License
11 stars 1 forks source link

System.Numerics.Tensors #16

Open sinshu opened 2 weeks ago

sinshu commented 2 weeks ago

Investigate whether using Tensor<T> in backend operations can improve speed.

Relevant materials: https://github.com/dotnet/core/blob/main/release-notes/9.0/preview/preview4/libraries.md#new-tensort-type https://learn.microsoft.com/en-us/dotnet/api/system.numerics.tensors?view=net-8.0 https://github.com/dotnet/runtime/issues/100924 https://github.com/dotnet/runtime/issues/103611 https://github.com/dotnet/runtime/issues/104117

Operations that System.Numerics.Tensors might be useful for so far:

In any case, first check whether TensorSpan<T> is compatible with the memory format of BLAS and LAPACK.

sinshu commented 1 week ago

Setting aside the backend calculations, it seems necessary to prepare methods like AsTensorSpan<T> for integration with the standard library.