Tpetra parallel linear algebra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Tpetra_Details_MatrixApplyHelper.hpp
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_MATRIX_APPLY_HELPER_HPP
11
#define TPETRA_MATRIX_APPLY_HELPER_HPP
12
13
#include "Kokkos_Core.hpp"
14
#include "KokkosSparse_spmv_handle.hpp"
15
#include "Tpetra_Details_IntRowPtrHelper.hpp"
16
17
namespace
Tpetra
{
18
namespace
Details
{
19
27
template
<
typename
LocalMatrix,
typename
IntLocalMatrix,
typename
MultiVectorLocalView>
28
struct
MatrixApplyHelper :
public
IntRowPtrHelper<LocalMatrix, IntLocalMatrix> {
29
// using Rowptrs = typename LocalMatrix::row_map_type;
30
// using IntRowptrs = typename IntLocalMatrix::row_map_type;
31
using
XVectorType =
typename
MultiVectorLocalView::const_type;
32
using
YVectorType = MultiVectorLocalView;
33
using
SPMVHandle = KokkosSparse::SPMVHandle<typename LocalMatrix::device_type, LocalMatrix, XVectorType, YVectorType>;
34
using
SPMVHandleInt = KokkosSparse::SPMVHandle<typename LocalMatrix::device_type, IntLocalMatrix, XVectorType, YVectorType>;
35
36
MatrixApplyHelper(
size_t
nnz,
const
typename
LocalMatrix::row_map_type& rowptrs, KokkosSparse::SPMVAlgorithm algo = KokkosSparse::SPMV_DEFAULT)
37
: IntRowPtrHelper<LocalMatrix, IntLocalMatrix>(nnz, rowptrs)
38
, handle_int(algo) {}
39
40
// SPMVHandles are lazily initialized by actual spmv calls.
41
// We declare both here because we don't know until runtime (based on nnz) which should be used.
42
SPMVHandle handle;
43
SPMVHandleInt handle_int;
44
};
45
}
// namespace Details
46
}
// namespace Tpetra
47
48
#endif
// TPETRA_MATRIX_APPLY_HELPER_HPP
Tpetra::Details
Nonmember function that computes a residual Computes R = B - A * X.
Definition
Tpetra_KokkosRefactor_Details_MultiVectorLocalDeepCopy.hpp:17
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Generated by
1.17.0