Tpetra parallel linear algebra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Tpetra_Details_DefaultTypes.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_DETAILS_DEFAULTTYPES_HPP
11
#define TPETRA_DETAILS_DEFAULTTYPES_HPP
12
13
#include "TpetraCore_config.h"
14
#include "Tpetra_KokkosClassic_DefaultNode_config.h"
15
#include "Tpetra_KokkosCompat_ClassicNodeAPI_Wrapper.hpp"
16
18
namespace
Tpetra
{
19
22
namespace
Details
{
23
29
namespace
DefaultTypes
{
31
#if defined(HAVE_TPETRA_INST_DOUBLE)
32
using
scalar_type
= double;
33
#elif defined(HAVE_TPETRA_INST_FLOAT)
34
using
scalar_type
= float;
35
#else
36
#error "Tpetra: No scalar types in the set {float, double} have been enabled."
37
#endif
38
40
using
local_ordinal_type
= int;
41
44
#if defined(HAVE_TPETRA_INST_INT_LONG_LONG)
45
using
global_ordinal_type
=
long
long;
46
#elif defined(HAVE_TPETRA_INST_INT_INT)
47
using
global_ordinal_type
= int;
48
#elif defined(HAVE_TPETRA_INST_INT_LONG)
49
using
global_ordinal_type
= long;
50
#elif defined(HAVE_TPETRA_INST_INT_UNSIGNED_LONG)
51
using
global_ordinal_type
=
unsigned
long;
52
#elif defined(HAVE_TPETRA_INST_INT_UNSIGNED)
53
using
global_ordinal_type
= unsigned;
54
#else
55
#error "Tpetra: No global ordinal types in the set {int, long long, long, unsigned long, unsigned} have been enabled."
56
#endif
57
60
#if defined(HAVE_TPETRA_DEFAULTNODE_SYCLWRAPPERNODE)
61
using
execution_space
= ::Kokkos::Experimental::SYCL;
62
using
node_type
= Tpetra::KokkosCompat::KokkosSYCLWrapperNode;
63
#elif defined(HAVE_TPETRA_DEFAULTNODE_HIPWRAPPERNODE)
64
using
execution_space
= ::Kokkos::HIP;
65
using
node_type
= Tpetra::KokkosCompat::KokkosHIPWrapperNode;
66
#elif defined(HAVE_TPETRA_DEFAULTNODE_CUDAWRAPPERNODE)
67
using
execution_space
= ::Kokkos::Cuda;
68
using
node_type
= Tpetra::KokkosCompat::KokkosCudaWrapperNode;
69
#elif defined(HAVE_TPETRA_DEFAULTNODE_OPENMPWRAPPERNODE)
70
using
execution_space
= ::Kokkos::OpenMP;
71
using
node_type
= Tpetra::KokkosCompat::KokkosOpenMPWrapperNode;
72
#elif defined(HAVE_TPETRA_DEFAULTNODE_THREADSWRAPPERNODE)
73
using
execution_space
= ::Kokkos::Threads;
74
using
node_type
= Tpetra::KokkosCompat::KokkosThreadsWrapperNode;
75
#elif defined(HAVE_TPETRA_DEFAULTNODE_SERIALWRAPPERNODE)
76
using
execution_space
= ::Kokkos::Serial;
77
using
node_type
= Tpetra::KokkosCompat::KokkosSerialWrapperNode;
78
#else
79
#error "No default Tpetra Node type specified. Please set the CMake option Tpetra_DefaultNode to a valid Node type."
80
#endif
81
85
86
template
<
typename
ExecutionSpace>
87
struct
CommBufferMemorySpace
{
88
using
type =
typename
ExecutionSpace::memory_space;
89
};
90
91
#ifdef KOKKOS_ENABLE_CUDA
92
template
<>
93
struct
CommBufferMemorySpace
<Kokkos::Cuda> {
94
using
type = Kokkos::CudaSpace;
95
};
96
#endif
97
98
#ifdef KOKKOS_ENABLE_HIP
99
template
<>
100
struct
CommBufferMemorySpace<Kokkos::HIP> {
101
using
type = Kokkos::HIPSpace;
102
};
103
#endif
104
105
#ifdef KOKKOS_ENABLE_SYCL
106
template
<>
107
struct
CommBufferMemorySpace<Kokkos::Experimental::SYCL> {
108
using
type = Kokkos::Experimental::SYCLDeviceUSMSpace;
109
};
110
#endif
111
112
template
<
typename
Device>
113
using
comm_buffer_memory_space =
typename
CommBufferMemorySpace<typename Device::execution_space>::type;
114
115
}
// namespace DefaultTypes
116
117
}
// namespace Details
118
119
}
// namespace Tpetra
120
121
#endif
// TPETRA_DETAILS_DEFAULTTYPES_HPP
Tpetra::execution_space
Tpetra::scalar_type
Tpetra::Details::DefaultTypes
Declarations of values of Tpetra classes' default template parameters.
Definition
Tpetra_Details_DefaultTypes.hpp:29
Tpetra::Details::DefaultTypes::local_ordinal_type
int local_ordinal_type
Default value of Scalar template parameter.
Definition
Tpetra_Details_DefaultTypes.hpp:40
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.
Tpetra::Details::DefaultTypes::CommBufferMemorySpace
Memory space used for MPI communication buffers.
Definition
Tpetra_Details_DefaultTypes.hpp:87
Generated by
1.17.0