Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_Details_getGraphOffRankOffsets_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRA_DETAILS_GETGRAPHOFFRANKOFFSETS_DECL_HPP
11#define TPETRA_DETAILS_GETGRAPHOFFRANKOFFSETS_DECL_HPP
12
17
18#include "TpetraCore_config.h"
19#include "Kokkos_Core.hpp"
20#include "KokkosSparse_StaticCrsGraph.hpp"
22#include <type_traits>
23
24namespace Tpetra {
25namespace Details {
26namespace Impl {
27
41template <class LO,
42 class GO,
43 class DeviceType,
44 class OffsetType = size_t>
46 public:
47 typedef typename DeviceType::device_type device_type;
48 typedef OffsetType offset_type;
49 typedef ::Kokkos::View<offset_type*,
50 device_type,
51 ::Kokkos::MemoryUnmanaged>
52 offsets_type;
53 using local_graph_type = ::KokkosSparse::StaticCrsGraph<LO,
54 ::Kokkos::LayoutLeft,
55 device_type, void, size_t>;
56 typedef ::Tpetra::Details::LocalMap<LO, GO, device_type> local_map_type;
57 typedef ::Kokkos::View<const typename local_graph_type::size_type*,
58 ::Kokkos::LayoutLeft,
59 device_type,
60 ::Kokkos::MemoryUnmanaged>
61 row_offsets_type;
62 // This is unmanaged for performance, because we need to take
63 // subviews inside the functor.
64 typedef ::Kokkos::View<const LO*,
65 ::Kokkos::LayoutLeft,
66 device_type,
67 ::Kokkos::MemoryUnmanaged>
68 lcl_col_inds_type;
69
71 GetGraphOffRankOffsets(const offsets_type& OffRankOffsets,
74 const row_offsets_type& ptr,
75 const lcl_col_inds_type& ind);
76
78 KOKKOS_FUNCTION void operator()(const LO& lclRowInd) const;
79
80 private:
81 offsets_type OffRankOffsets_;
82 local_map_type lclColMap_;
83 local_map_type lclDomMap_;
84 row_offsets_type ptr_;
85 lcl_col_inds_type ind_;
86 LO lclNumRows_;
87};
88
89} // namespace Impl
90
91template <class OffsetsType,
92 class LclMapType,
93 class LclGraphType>
94void getGraphOffRankOffsets(const OffsetsType& OffRankOffsets,
95 const LclMapType& lclColMap,
96 const LclMapType& lclDomMap,
97 const LclGraphType& lclGraph) {
98 typedef typename OffsetsType::non_const_value_type offset_type;
99 typedef typename LclMapType::local_ordinal_type LO;
100 typedef typename LclMapType::global_ordinal_type GO;
101 typedef typename LclMapType::device_type DT;
102
104
105 // The functor's constructor runs the functor.
107}
108
109} // namespace Details
110} // namespace Tpetra
111
112#endif // TPETRA_DETAILS_GETGRAPHOFFRANKOFFSETS_DECL_HPP
Declaration and definition of the Tpetra::Map class, an implementation detail of Tpetra::Map.
Struct that holds views of the contents of a CrsMatrix.
Implementation detail of Tpetra::Details::getGraphOffRankOffsets, which in turn is an implementation ...
KOKKOS_FUNCTION void operator()(const LO &lclRowInd) const
Kokkos::parallel_for loop body.
Implementation details of Tpetra.
Namespace Tpetra contains the class and methods constituting the Tpetra library.