Subroutine: the use of template parameter packs
This update is a complete redesign of our Level 1 dispatch system and significantly enhances its usability, while still being entirely backwards compatible (there is one exception, see below) and reproducible with the existing master branch. The main novelty is the use of C++11 template parameter packs in a newly designed blas1 function. We carefully designed and implemented a set of rules to consistently and intuitively dispatch parameters while staying backwards compatible with existing code. The update includes
- the new dg::blas1::subroutine function, which takes an arbitrary number of parameters, which can all have different types.
- the possibility to pass Scalars (double, int float...) as vector or matrix arguments in any blas1 and blas2 function
- the possibility to pass varying types to any blas1 and blas2 function
- new documentation of the Level 1, please rerun make doc in the feltor/doc folder to update your documentation
- new tests and additional benchmarks in blas_t.cu and blas_b.cu and corresponding mpi versions.
As a second minor addition we address the problem of multiple translation units. In the previous implementation we had an unfortunate mix of template and non-template functions and classes that prevented the inclusion of dg/algorithm.h in seperate translation units. We now consistently make all functions and classes templates (or declare them static). This specifically includes our Grid classes. All changes are compatible with existing code. However, note that the geometries.h header still has this problem.
The update passed the tests in feltor/inc/dg for both omp and gpu as well as mpi + omp and the toefl code remains binary identical with the master version. Nevertheless, if you experience problems, please contact me.
ATTENTION: while the update is in principle backwards compatible, we changed the name of VectorTraits to TensorTraits and unified vector_category and matrix_category to tensor_category. These are however rarely used in User code.