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

Deprecate OffsetView constructors taking index_list_type #4810

Merged

Conversation

masterleinad
Copy link
Contributor

While looking at #4805, I found a OffsetView constructor taking index_list_type,i.e., std::initializer_list, objects as argument to denote begin and end for every dimension. This pull request deprecates that behavior to use std::pair instead so that specifying too many arguments is not possible.

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine beside the adding Kokkos::Experimental::range_type

containers/src/Kokkos_OffsetView.hpp Outdated Show resolved Hide resolved
@masterleinad
Copy link
Contributor Author

Looks fine beside the adding Kokkos::Experimental::range_type

Do you prefer to use std::pair directly instead of the alias then?

@dalg24
Copy link
Member

dalg24 commented Feb 22, 2022

As long we are not injecting an alias in the namespace.
Note that you could write your constructor to take anything that supports std::get<{0,1}>(R const&) with std::tuple_size<R>::value==2

@masterleinad
Copy link
Contributor Author

Note that you could write your constructor to take anything that supports std::get<{0,1}>(R const&) with std::tuple_size<R>::value==2

I prefer to have a constructor that allows me to do

offset_view_type("o1", {-1, 3}, {-2,2});

and I don't see a need to introduce another templated one taking other tuple-like containers yet.

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment about the design choices above the constructor.

@masterleinad
Copy link
Contributor Author

Retest this please.

@crtrott crtrott merged commit c64a95d into kokkos:develop Mar 2, 2022
@ajpowelsnl ajpowelsnl mentioned this pull request Nov 7, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants