Increase data type flexibility
The current implementation of support for mixed execution spaces (!188 (merged)) imposes strict compatibility requirements on data types. However, Kokkos views have greater flexibility than what this enforces. In particular, views can be of different types and yet still be compatible, so long as their memory spaces are accessible from one another. For example, OpenMP and serial views are both host-space views. Assignment between them should be allowed.
IPPL should be adapted to allow greater flexibility with data types. Instead of imposing exactly matching data types, the view types should be free a priori and compatibility should be statically verified using existing Kokkos metaprogramming tools. This will make it possible to use views in different but compatible memory spaces in operations, e.g. scattering OpenMP particles to a serial field.
This will also relax the requirements on using uniform types in certain places.
It should be possible to implement this in a very readable manner using C++20 concepts and constraints. The requires
clause could drastically cut down on compilation error message lengths and provide simple static verification of memory space compatibility. The Kokkos team may be considering similar changes in future versions; we should discuss with them whether and how they plan on integrating concepts into their codebase. See example. See also this StackOverflow post.