xtensor-blas
xtensor-blas copied to clipboard
[WIP] xt::linalg::kron: support arguments of arbitrary number of dimensions
Before this commit, xt::linalg::kron
only supports 2D arguments. This
commit proposes to add support for argument with any number of
dimensions. This change of behavior is coherent with what numpy.kron
does.
The current implementation is a performance step back compared to the previous one. Until a better generic implementation is found, keeping a couple of specialized implementations for the most used scenarios makes sense.
Tested with ./test/test_xtensor_blas --gtest_filter=xlinalg.kron*
.
I have pushed a revised implementation that has significantly better performances compared to the first one. However, it still is an order of magnitude slower than the original one for the 2D scenario.
I intend to spend more time on this to improve things further and hopefully come up with a solution that is general and offers acceptable performances.