10#ifndef TPETRA_DETAILS_GETDIAGCOPYWITHOUTOFFSETS_DECL_HPP
11#define TPETRA_DETAILS_GETDIAGCOPYWITHOUTOFFSETS_DECL_HPP
22#include "TpetraCore_config.h"
23#include "Kokkos_Core.hpp"
24#if KOKKOS_VERSION >= 40799
25#include "KokkosKernels_ArithTraits.hpp"
27#include "Kokkos_ArithTraits.hpp"
30#include "Tpetra_RowMatrix_decl.hpp"
49template <
class DiagType,
53 typedef typename LocalMapType::local_ordinal_type LO;
54 typedef typename LocalMapType::global_ordinal_type GO;
55 typedef typename CrsMatrixType::device_type device_type;
56 typedef typename CrsMatrixType::value_type scalar_type;
57 typedef typename CrsMatrixType::size_type offset_type;
83 const LO
INV = Tpetra::Details::OrdinalTraits<LO>::invalid();
84 const scalar_type
ZERO =
85#if KOKKOS_VERSION >= 40799
86 KokkosKernels::ArithTraits<scalar_type>::zero();
88 Kokkos::ArithTraits<scalar_type>::zero();
154static typename LocalMapType::local_ordinal_type
159 static_assert(Kokkos::is_view<DiagType>::value,
160 "DiagType must be a Kokkos::View.");
161 static_assert(
static_cast<int>(DiagType::rank) == 1,
162 "DiagType must be a 1-D Kokkos::View.");
163 static_assert(std::is_same<typename DiagType::value_type, typename DiagType::non_const_value_type>::value,
164 "DiagType must be a nonconst Kokkos::View.");
165 typedef typename LocalMapType::local_ordinal_type LO;
166 typedef typename CrsMatrixType::device_type device_type;
167 typedef typename device_type::execution_space execution_space;
168 typedef Kokkos::RangePolicy<execution_space, LO> policy_type;
170 typedef Kokkos::View<
typename DiagType::non_const_value_type*,
171 typename DiagType::array_layout,
172 typename DiagType::device_type,
173 Kokkos::MemoryUnmanaged>
178 const LO
numRows =
static_cast<LO
>(
D.extent(0));
220template <
class SC,
class LO,
class GO,
class NT>
222 const ::Tpetra::RowMatrix<SC, LO, GO, NT>&
A,
Import KokkosSparse::OrdinalTraits, a traits class for "invalid" (flag) values of integer types,...
Declaration of the Tpetra::Vector class.
Struct that holds views of the contents of a CrsMatrix.
Implementation details of Tpetra.
LO getLocalDiagCopyWithoutOffsetsNotFillComplete(::Tpetra::Vector< SC, LO, GO, NT > &diag, const ::Tpetra::RowMatrix< SC, LO, GO, NT > &A, const bool debug=false)
Given a locally indexed, global sparse matrix, extract the matrix's diagonal entries into a Tpetra::V...
static LocalMapType::local_ordinal_type getDiagCopyWithoutOffsets(const DiagType &D, const LocalMapType &rowMap, const LocalMapType &colMap, const CrsMatrixType &A)
Given a locally indexed, local sparse matrix, and corresponding local row and column Maps,...
Namespace Tpetra contains the class and methods constituting the Tpetra library.
@ ZERO
Replace old values with zero.
Functor that implements much of the one-argument overload of Tpetra::CrsMatrix::getLocalDiagCopy,...
CrsMatrixGetDiagCopyFunctor(const DiagType &D, const LocalMapType &rowMap, const LocalMapType &colMap, const CrsMatrixType &A)
Constructor.
LO value_type
The result of the reduction; number of errors.
KOKKOS_FUNCTION void operator()(const LO &lclRowInd, value_type &errCount) const
Operator for Kokkos::parallel_for.