Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_LocalOperator.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_LOCALOPERATOR_HPP
11#define TPETRA_LOCALOPERATOR_HPP
12
14#include "Teuchos_BLAS_types.hpp"
15#include "KokkosKernels_ArithTraits.hpp"
16#include <type_traits>
17
18namespace Tpetra {
19
28template <class Scalar, class Device>
30 public:
31 using scalar_type = typename KokkosKernels::ArithTraits<Scalar>::val_type;
32 using array_layout = Kokkos::LayoutLeft;
33 using device_type =
34 Kokkos::Device<typename Device::execution_space,
35 typename Device::memory_space>;
36
37 virtual ~LocalOperator() = default;
38
47 virtual void
48 apply(Kokkos::View<const scalar_type**, array_layout,
49 device_type, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
50 X,
51 Kokkos::View<scalar_type**, array_layout,
52 device_type, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
53 Y,
54 const Teuchos::ETransp mode,
55 const scalar_type alpha,
56 const scalar_type beta) const = 0;
57
58 virtual bool hasTransposeApply() const { return false; }
59};
60
61} // namespace Tpetra
62
63#endif // TPETRA_LOCALOPERATOR_HPP
Forward declaration of Tpetra::LocalCrsMatrixOperator.
Struct that holds views of the contents of a CrsMatrix.
Abstract interface for local operators (e.g., matrices and preconditioners).
virtual void apply(Kokkos::View< const scalar_type **, array_layout, device_type, Kokkos::MemoryTraits< Kokkos::Unmanaged > > X, Kokkos::View< scalar_type **, array_layout, device_type, Kokkos::MemoryTraits< Kokkos::Unmanaged > > Y, const Teuchos::ETransp mode, const scalar_type alpha, const scalar_type beta) const =0
Compute Y := beta*Y + alpha*Op(A)*X.
Namespace Tpetra contains the class and methods constituting the Tpetra library.