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

Zoltan2: Don't access DualView's [h|d]_view directly #13787

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ BasicKokkosIdentifierAdapter<User>::BasicKokkosIdentifierAdapter(
Kokkos::View<scalar_t **, device_t> &weights)
{
idsView_ = Kokkos::DualView<gno_t *, device_t>("idsView_", ids.extent(0));
Kokkos::deep_copy(idsView_.h_view, ids);
Kokkos::deep_copy(idsView_.view_host(), ids);

weightsView_ = Kokkos::DualView<scalar_t **, device_t>("weightsView_",
weights.extent(0),
weights.extent(1));
Kokkos::deep_copy(weightsView_.h_view, weights);
Kokkos::deep_copy(weightsView_.view_host(), weights);

weightsView_.modify_host();
weightsView_.sync_host();
Expand Down
2 changes: 1 addition & 1 deletion packages/zoltan2/sphynx/src/Zoltan2_Sphynx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ namespace Zoltan2 {

// D^{-1/2}
dual_view_t dv ("MV::DualView", numRows, 1);
auto deginvsqrt = dv.d_view;
auto deginvsqrt = dv.view_device();

// Get the diagonal offsets
offset_view_t diagOffsets(Kokkos::view_alloc("Diag Offsets", Kokkos::WithoutInitializing), numRows);
Expand Down
8 changes: 4 additions & 4 deletions packages/zoltan2/test/core/partition/mj_backwardcompat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class KokkosVectorAdapter : public Zoltan2::VectorAdapter<User>
kokkos_gids = view_ids_t(
Kokkos::ViewAllocateWithoutInitializing("gids"), nids);

auto host_gids = kokkos_gids.h_view;
auto host_gids = kokkos_gids.view_host();
for(size_t n = 0; n < nids; ++n) {
host_gids(n) = gids_[n];
}
Expand All @@ -150,7 +150,7 @@ class KokkosVectorAdapter : public Zoltan2::VectorAdapter<User>
typedef Kokkos::DualView<scalar_t **, device_t> view_weights_t;
kokkos_weights = view_weights_t(
Kokkos::ViewAllocateWithoutInitializing("weights"), nids, 0);
auto host_kokkos_weights = kokkos_weights.h_view;
auto host_kokkos_weights = kokkos_weights.view_host();
for(size_t n = 0; n < nids; ++n) {
host_kokkos_weights(n,0) = weights_[n];
}
Expand All @@ -165,7 +165,7 @@ class KokkosVectorAdapter : public Zoltan2::VectorAdapter<User>
typedef Kokkos::DualView<scalar_t **, Kokkos::LayoutLeft, device_t> kokkos_coords_t;
kokkos_coords = kokkos_coords_t(
Kokkos::ViewAllocateWithoutInitializing("coords"), nids, dim);
auto host_kokkos_coords = kokkos_coords.h_view;
auto host_kokkos_coords = kokkos_coords.view_host();

for(size_t n = 0; n < nids; ++n) {
for(int idx = 0; idx < dim; ++idx) {
Expand All @@ -190,7 +190,7 @@ class KokkosVectorAdapter : public Zoltan2::VectorAdapter<User>
ids = kokkos_gids.template view<device_t>();
}

int getNumWeightsPerID() const { return (kokkos_weights.h_view.size() != 0); }
int getNumWeightsPerID() const { return (kokkos_weights.view_host().size() != 0); }

void getWeightsView(const scalar_t *&wgt, int &stride,
int idx = 0) const override
Expand Down
Loading