-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move intelligence to Impl::create_mirror*
#7
base: refactor/create-mirror/constexpr
Are you sure you want to change the base?
Move intelligence to Impl::create_mirror*
#7
Conversation
…mirror/move_intelligence
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.
Be sure to run clang-format8
.
core/src/Kokkos_CopyViews.hpp
Outdated
typename Kokkos::View<T, P...>::HostMirror create_mirror_view( | ||
auto create_mirror_view( |
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.
Be sure that auto
works properly on all platforms.
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.
We should run all the different backends with the minimum supported compilers. So far, we could build for Serial, CUDA and SYCL (latest versions of compilers, mostly).
…:CopyUnInit more robust Do not rely on `Impl::` objects in the test file.
…mirror/move_intelligence
…mirror/move_intelligence
…mirror/move_intelligence
This PR aims to simplify the code by moving the duplicated intelligence of
create_mirror
andcreate_mirror_view
toImpl::create_mirror
andImpl::create_mirror_view
. The former functions now behave as a pass-trough that only call theirImpl::
counterpart.This PR is part of a of a larger effort which aims to fix kokkos#6842.
A functor
CopyUnInit
is implemented in the test filecore/unit_test/TestViewAPI.hpp
which contains a View as an attribute whose type is hard-coded using aMirrorViewType
implementation object here (it is the only test in the file containing an implementation object). The type expected by the functor is a view whoseSpace
parameter corresponds to the templateSpace
indicated in the same functor here.In the develop branch, the overload of the create_mirror function called in the test imposes the following return type:
Impl::MirrorViewType<Space, T, P...>::view_type
which matches the type expected by the constructor of the functor in the test.In this branch, the return types of the functions are auto. Therefore, the return value is decided at a single place. The overload of create_mirror_view called calls the function
Impl::create_mirror_view
, which in turn calls the functioncreate_mirror
, which returns the following type:Impl::MirrorType<memory_space, T, P...>::view_type
that does not match the type expected by the constructor of the test because of theSpace::memory_space
passed as aSpace
parameter to the output View.It should be noted that in the develop branch, several return values are set, but they are different.
To fix the mismatch of types encountered with this PR, we decided to simplify the test code by removing the hard-coded type and simply deducing the object's type by passing it to the constructor. It should be noted that this functor is not used anywhere else in the code.
Tests:
8.2.08.4.0 with OpenMP;8.2.08.4.0 with CUDA11.011.4;19.0.52023.2.1 with OpenMP;2022.0.02024.0.2 with SYCL;2021.1.12023.2.1 with OpenMP;