xsimd icon indicating copy to clipboard operation
xsimd copied to clipboard

scalar implementation without code duplication

Open actual-daniel opened this issue 5 months ago • 4 comments

I'm currently a bit confused about the purpose of xsimd::generic. My expectation was that its possible to use this architecture as a fallback or for development purposes. For this I would assume that xsimd::batch<T, xsimd::generic> just contains a single scalar value. But this is not the case - Instead the build fails because xsimd::has_simd_register is false.

I could specialize load_* and broadcast calls and try to separate it from the rest of the implementation which then hopefully works with scalar and simd types. But it feels like this could be abstracted through implementation of the generic architecture.

Is there a reason why this is not done? Are there examples how to write simd and scalar implementations without duplicating code?

actual-daniel avatar Jan 18 '24 13:01 actual-daniel