Skip to content

[kritamultiarch] Introduce a multi-architecture dispatcher library

This MR introduces the first part of the multi-architecture dispatch refactor.

In this opportunity, I've factored out the logic managing xsimd into a standalone shared library called "kritamultiarch". The objective of this effort is to:

  • ensure a compiler-enforced, cached, unique source of truth for instruction set detection and dispatching,
  • removing the dependency on kritapigment for architecture dependent code,
  • and enabling the dispatch of functors as well as classes through a templated function with std::forwarded parameters and automatically deduced return type.

As part of this refactor, I've cleaned up all the logic involving instruction set dispatch, and the compositeop factories. The latter no longer require neither explicitly typed return types, nor dummy parameters at all, so I can drop a few classes.

In the next MR, I plan to demonstrate the application of this approach for dispatching heavily templated, optimized functors.

Test Plan

Build Krita and run tests.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

/cc @rempt @woltherav @dragonmux

Edited by Amy spark

Merge request reports