PrincetonUniversity / SPECFEMPP

SPECFEM++ is a complete re-write of SPECFEM suite of packages (SPECFEM2D, SPECFEM3D, SPECFEM3D_GLOBE) using C++
https://specfem2d-kokkos.readthedocs.io/en/latest/
GNU General Public License v3.0
16 stars 9 forks source link

Namespace usage could be more consistent and cleaner #109

Open lsawade opened 7 hours ago

lsawade commented 7 hours ago

Namespace usage could be more consistent

E.g. This example from the Kokkos iterators.

namespace KE = Kokkos::Experimental;
using view_type = Kokkos::View<int*>;
view_type a("a", 15);

auto it = KE::begin(a);
// if dereferenced (within a proper execution space), can modify the content of `a`

auto itc = KE::cbegin(a);
// if dereferenced (within a proper execution space), can only read the content of `a`

Here it is clear that ...::begin and ...::cbegin are part of the Kokkos::Experimental section. Reminiscent of import numpy as np (I assume cpp did it first). Adds clarity for the reader.

It makes it much easier to learn the code without constantly right-clicking and asking for the definition/origin in your IDE.

Describe the solution you'd like

This is just basic refactoring.

Maybe a deliberate decision?

Please elaborate.