-
Notifications
You must be signed in to change notification settings - Fork 406
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
Refactor: Replace SFINAE by if constexpr
for create_mirror*
functions
#6955
Refactor: Replace SFINAE by if constexpr
for create_mirror*
functions
#6955
Conversation
…/CExA-project/kokkos into refactor/create-mirror/constexpr
You'll have to fix indentation. |
The code style was fixed using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me but we should test with Trilinos/Sacado/Stokhos just to make sure this doesn't break their customizations.
Can you please rebase on top of |
Merging done. For merging, can you squash the commits, as the history of this branch is quite messy? |
Yes, we normally squash commits before merging. |
I think I merged the latest version of |
Could you recommend any build script for Trilinos, in order to test it? |
Yes, it seems an update in our CI containers is responsible for the build failures. #6969 fixes one of them. |
Retest this please! |
@crtrott Could you validate this PR? It seems the failing jobs are due to external factors. |
This PR is a refactor without side effects.
The idea is to simplify the code of the
create_mirror*
functions by applying techniques of the C++ 17 standard. A refactor with the similar approach was drafted by @masterleinad in #5533 about two years ago, but never merged.The multiple overloaded functions of
Impl::create_mirror
,Impl::create_mirror_view
, andImpl::create_mirror_view_and_copy
that use SFINAE are replaced by one function that usesif constexpr
instead (for Kokkos views, offset views, dynamic views and dynamic rank views). Eventually, the return type of these functions is replaced byauto
, and decided depending on which branch of theif constexpr
is used.The logic of the public
create_mirror*
functions (which is sometimes redundant with the logic of the private functions) is not altered in this PR and will be assessed in an upcoming one.This PR is part of a of a larger effort which aims to assess #6842.
We successfully built and tested the refactored code for the following configurations:
where "Compiler" is the used compiler, next "Version" is the version of the compiler, next "Min. Vers." is the minimum version of the compiler for Kokkos 4.3.0 according to the documentation, "Backend" is the name of the backend, next "Version" is the version for the backend if necessary, and next "Min. Vers." is the minimum version of the backend supported.
Unfortunately, we could not test any earlier version of the compilers, nor of the backends, on our test machines. Also, please note that some configurations could not be used:
Finally, the SYCL configuration was built, but not tested.