xtensor-stack/xsimd

`xsimd::make_sized_batch` returns `void` for `std::complex`

Closed this issue · 0 comments

I noticed that xsimd::make_sized_batch returns void for complex batches even when the batch is otherwise available.

It seems to me that the reason is that XSIMD_DECLARE_SIMD_REGISTER is never called for std::complex<T>, only for reals, but make_sized_batch uses this macro for detecting architectures of a certain size.

I think this could be resolved by having XSIMD_DECLARE_SIMD_REGISTER declare the complex counterparts automatically when SCALAR_TYPE is std::is_floating_point_v. The other option would be to modify the declarations for all architectures to include XSIMD_DECLARE_SIMD_REGISTER(std::complex<T>, ARCH) as well. It would also be possible to specialize has_simd_register for std::complex<T> to inherit from has_simd_register<T>.