Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace usage could be more consistent and cleaner #109

Open
lsawade opened this issue Oct 8, 2024 · 0 comments
Open

Namespace usage could be more consistent and cleaner #109

lsawade opened this issue Oct 8, 2024 · 0 comments

Comments

@lsawade
Copy link
Collaborator

lsawade commented Oct 8, 2024

** 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant