50 #ifndef _ZOLTAN2_BASICKOKKOSIDENTIFIERADAPTER_HPP_
51 #define _ZOLTAN2_BASICKOKKOSIDENTIFIERADAPTER_HPP_
53 #include <Kokkos_Core.hpp>
83 template <
typename User>
109 Kokkos::View<scalar_t**, weight_layout_t> &
weights);
122 if (idx < 0 ||
scalar_t(idx) >= weightsView_.extent(0)) {
123 std::ostringstream emsg;
124 emsg << __FILE__ <<
":" << __LINE__
125 <<
" Invalid weight index " << idx << std::endl;
126 throw std::runtime_error(emsg.str());
128 wgt = Kokkos::subview(weightsView_, ALL, idx);
132 Kokkos::View<gno_t *> idsView_;
133 Kokkos::View<scalar_t **, weight_layout_t> weightsView_;
140 template <
typename User>
142 Kokkos::View<gno_t*> &ids,
143 Kokkos::View<scalar_t**, weight_layout_t> &
weights):
144 idsView_(ids), weightsView_(weights) {
IdentifierAdapter defines the interface for identifiers.
void getIDsKokkosView(Kokkos::View< gno_t * > &ids) const
Provide a pointer to this process' identifiers.
InputTraits< User >::scalar_t scalar_t
Defines the IdentifierAdapter interface.
BasicKokkosIdentifierAdapter(Kokkos::View< gno_t * > &ids, Kokkos::View< scalar_t **, weight_layout_t > &weights)
Constructor.
void getWeightsKokkosView(Kokkos::View< scalar_t * > &wgt, int idx=0) const
Provide pointer to a weight View.
This class represents a collection of global Identifiers and their associated weights, if any.
InputTraits< User >::part_t part_t
size_t getLocalNumIDs() const
Returns the number of objects on this process.
InputTraits< User >::lno_t lno_t
InputTraits< User >::node_t node_t
int getNumWeightsPerID() const
Returns the number of weights per object. Number of weights per object should be zero or greater...
InputTraits< User >::gno_t gno_t
Kokkos::LayoutLeft weight_layout_t
This file defines the StridedData class.