Amesos2 - Direct Sparse Solver Interfaces Version of the Day
Amesos2_VectorTraits.hpp
1// @HEADER
2// *****************************************************************************
3// Amesos2: Templated Direct Sparse Solver Package
4//
5// Copyright 2011 NTESS and the Amesos2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10
11#ifndef AMESOS2_VECTORTRAITS_HPP
12#define AMESOS2_VECTORTRAITS_HPP
13
14//#include "Amesos2_config.h"
15
16#include <Tpetra_MultiVector.hpp>
17
18
19namespace Amesos2 {
20
21 // The declaration
22 template <class Vector>
23 struct VectorTraits {};
24
25 /*******************
26 * Specializations *
27 *******************/
28
29 template < typename Scalar,
30 typename LocalOrdinal,
31 typename GlobalOrdinal,
32 typename Node >
33 struct VectorTraits<
34 Tpetra::MultiVector<Scalar,
35 LocalOrdinal,
36 GlobalOrdinal,
37 Node> > {
38 typedef Scalar scalar_t;
39 typedef LocalOrdinal local_ordinal_t;
40 typedef GlobalOrdinal global_ordinal_t;
41 typedef Node node_t;
42
43 typedef Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> multivector_type;
44 typedef typename multivector_type::impl_scalar_type ptr_scalar_type; // TODO Make this a pointer
45 };
46
47 template < typename Scalar,
48 typename ExecutionSpace >
49 struct VectorTraits<
50 Kokkos::View<Scalar**,Kokkos::LayoutLeft,ExecutionSpace> > {
51 typedef Scalar scalar_t;
52 typedef int local_ordinal_t;
53 typedef Tpetra::Map<>::global_ordinal_type global_ordinal_t;
54 typedef Tpetra::Map<>::node_type node_t;
55
56 typedef Kokkos::View<Scalar**,Kokkos::LayoutLeft,ExecutionSpace> multivector_type;
57 typedef Scalar ptr_scalar_type; // TODO Make this a pointer
58 };
59
60}
61
62#endif // AMESOS2_VECTORTRAITS_HPP