Optimize strided loop assignment for runtime-contiguous layout types with contiguous assignment by Ivorforce · Pull Request #2810 · xtensor-stack/xtensor

Checklist

  • The title and commit message(s) are descriptive.
  • Small commits made to fix your PR have been squashed to avoid history pollution.
  • Tests have been added for new features or bug fixes.
  • API of new functions and classes are documented.

Description

This is important for types that are dynamic statically, but still contiguous at runtime. I haven't tested runtime gains yet, but I'm guessing it should have an impact (especially by taking #2809 as a model).

The duplicated !E1::contiguous_layout logic is to give compilers an easier time to evaluate the if as a constexpr, deleting the uncontiguous path for clearly statically contiguous layouts.