-
Notifications
You must be signed in to change notification settings - Fork 572
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
Tpetra: Don't access DualView's [h|d]_view directly #13778
base: develop
Are you sure you want to change the base?
Tpetra: Don't access DualView's [h|d]_view directly #13778
Conversation
Signed-off-by: Daniel Arndt <[email protected]>
Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
// DEEP_COPY REVIEW - DEVICE-TO-HOSTMIRROR | ||
Kokkos::deep_copy (execution_space(), devView, hostView); | ||
dv = dual_view_type (devView, hostView); | ||
execution_space().fence(); |
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.
This fence is new but seems necessary. The constructor will not fence and the deep_copy
is asynchronous. The function doesn't take an execution space instance argument so it should be synchronous.
Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; this inspection will remain valid until a new commit to source branch is performed. |
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: PR_gcc-openmpi-openmp
Jenkins Parameters
Build InformationTest Name: PR_gcc
Jenkins Parameters
Build InformationTest Name: PR_gcc-openmpi_debug
Jenkins Parameters
Build InformationTest Name: PR_clang
Jenkins Parameters
Build InformationTest Name: PR_cuda
Jenkins Parameters
Build InformationTest Name: PR_intel
Jenkins Parameters
Build InformationTest Name: PR_cuda-uvm
Jenkins Parameters
Using Repos:
Pull Request Author: masterleinad |
@@ -29,8 +29,8 @@ | |||
if (envVarSet && (std::strcmp(envVarSet,"1") == 0)) \ | |||
std::cout << (fn) << " called from " << callerstr \ | |||
<< " at " << filestr << ":"<<linnum \ | |||
<< " host cnt " << dualView.h_view.use_count() \ | |||
<< " device cnt " << dualView.d_view.use_count() \ | |||
<< " host cnt " << dualView.view_host().use_count() \ |
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.
I’m not sure if it’s an issue, but here, behavior changes, right? Because the getter is making a copy, so we’ll now report the previous use count incremented by one.
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.
Yes, in general all use counts will be larger but from what I understand only the difference between host and device is of relevance here.
@@ -210,7 +210,7 @@ class WrappedDualView { | |||
} | |||
|
|||
size_t extent(const int i) const { | |||
return dualView.h_view.extent(i); | |||
return dualView.view_host().extent(i); |
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.
This can probably become just dualView.extent(i)
.
@@ -551,11 +551,11 @@ class WrappedDualView { | |||
} | |||
|
|||
int host_view_use_count() const { | |||
return originalDualView.h_view.use_count(); | |||
return originalDualView.view_host().use_count(); |
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.
Here, the increment by one may be worth considering. Similar cases below.
Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED Pull Request Auto Testing has PASSED (click to expand)Build InformationTest Name: PR_gcc-openmpi-openmp
Jenkins Parameters
Build InformationTest Name: PR_gcc
Jenkins Parameters
Build InformationTest Name: PR_gcc-openmpi_debug
Jenkins Parameters
Build InformationTest Name: PR_clang
Jenkins Parameters
Build InformationTest Name: PR_cuda
Jenkins Parameters
Build InformationTest Name: PR_intel
Jenkins Parameters
Build InformationTest Name: PR_cuda-uvm
Jenkins Parameters
|
Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur... |
Signed-off-by: Daniel Arndt <[email protected]>
Status Flag 'Pull Request AutoTester' - User Requested Retest - Label AT: RETEST will be reset after testing. |
Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; this inspection will remain valid until a new commit to source branch is performed. |
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: PR_gcc-openmpi-openmp
Jenkins Parameters
Build InformationTest Name: PR_gcc
Jenkins Parameters
Build InformationTest Name: PR_gcc-openmpi_debug
Jenkins Parameters
Build InformationTest Name: PR_clang
Jenkins Parameters
Build InformationTest Name: PR_cuda
Jenkins Parameters
Build InformationTest Name: PR_intel
Jenkins Parameters
Build InformationTest Name: PR_cuda-uvm
Jenkins Parameters
Using Repos:
Pull Request Author: masterleinad |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED Pull Request Auto Testing has PASSED (click to expand)Build InformationTest Name: PR_gcc-openmpi-openmp
Jenkins Parameters
Build InformationTest Name: PR_gcc
Jenkins Parameters
Build InformationTest Name: PR_gcc-openmpi_debug
Jenkins Parameters
Build InformationTest Name: PR_clang
Jenkins Parameters
Build InformationTest Name: PR_cuda
Jenkins Parameters
Build InformationTest Name: PR_intel
Jenkins Parameters
Build InformationTest Name: PR_cuda-uvm
Jenkins Parameters
|
Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur... |
@trilinos/tpetra
Motivation
kokkos/kokkos#7716 proposes to deprecate the ability to access
DualView
'sh_view
andd_view
members directly since modifying the allocations can get perturbed theDualView
's internal status. This pull request replaces all places inTpetra
that use these members directly, in most places, verbatim withview_device
resp.view_host
.Related Issues
Related to kokkos/kokkos#7716.
Testing
Compiling Trilinos with
Tpetra
enabled with the OpenMP backend and running theTpetra
tests.Signed-off-by: Daniel Arndt [email protected]