Skip to content

Commit

Permalink
Merge Pull Request #13787 from masterleinad/Trilinos/zoltan2_access_h…
Browse files Browse the repository at this point in the history
…_d_view

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b"Zoltan2: Don't access DualView's [h|d]_view directly "
PR Author: masterleinad
  • Loading branch information
trilinos-autotester authored Feb 14, 2025
2 parents d13392b + 4f2f753 commit 2ab4550
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit 2ab4550

Please sign in to comment.