MueLu
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
MueLu_KokkosTuningInterface.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// MueLu: A package for multigrid based preconditioning
4
//
5
// Copyright 2012 NTESS and the MueLu contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef MUELU_KOKKOSTUNINGINTERFACE_HPP
11
#define MUELU_KOKKOSTUNINGINTERFACE_HPP
12
13
#include <string>
14
#include <vector>
15
#include "Teuchos_Comm.hpp"
16
#include "Teuchos_RCP.hpp"
17
#include "Teuchos_ArrayRCP.hpp"
18
#include "Teuchos_ParameterList.hpp"
19
#include "
MueLu_BaseClass.hpp
"
20
21
namespace
MueLu
{
22
29
class
KokkosTuningInterface
:
public
BaseClass
{
30
public
:
31
KokkosTuningInterface
(
const
Teuchos::RCP<
const
Teuchos::Comm<int>
>& comm);
32
33
virtual
~KokkosTuningInterface
() {}
34
35
Teuchos::RCP<const Teuchos::ParameterList>
GetValidParameterList
()
const
;
36
37
// Sets the input parameters for the KokkosTuneInterface
38
// NOTE: These are *not* the parameters which KokkosTuning is going to overwrite, rather the
39
// parameters to tell KokkosTuning what to do.
40
void
SetParameterList
(Teuchos::ParameterList& inParams) {
41
params_
= inParams;
42
Setup
();
43
}
44
45
// Calls Kokkos Tuning to set MueLu Parameters, manually specifying the Kokkos context ID
46
void
SetMueLuParameters
(
size_t
kokkos_context_id, Teuchos::ParameterList& mueluParams,
bool
overwrite =
true
)
const
;
47
48
// Calls Kokkos Tuning to set MueLu Parameters, using the Kokkos context ID on the list
49
void
SetMueLuParameters
(Teuchos::ParameterList& mueluParams,
bool
overwrite =
true
)
const
;
50
51
private
:
52
// Mapping unpacker
53
void
UnpackMueLuMapping
();
54
55
// String splitter
56
std::vector<std::string>
SplitString
(
const
std::string& base_string,
const
std::string& delimiter)
const
;
57
58
// Sets up Kokkos Tuning - This gets called from SetParameterList
59
void
Setup
();
60
61
// Cached data
62
Teuchos::RCP<const Teuchos::Comm<int> >
comm_
;
63
mutable
Teuchos::ParameterList
params_
;
// The mutable is a hack to deal with issues in Teuchos
64
65
// Tuning information
66
mutable
std::vector<Kokkos::Tools::Experimental::VariableValue>
in_variables
;
67
mutable
std::vector<Kokkos::Tools::Experimental::VariableValue>
out_variables
;
68
std::vector<std::string>
out_names
;
69
std::vector<std::string>
out_typenames
;
70
};
71
72
}
// namespace MueLu
73
74
#endif
// MUELU_KOKKOSTUNEINTERFACE_HPP
MueLu_BaseClass.hpp
MueLu::BaseClass
Base class for MueLu classes.
Definition
MueLu_BaseClass.hpp:27
MueLu::KokkosTuningInterface::SetParameterList
void SetParameterList(Teuchos::ParameterList &inParams)
Definition
MueLu_KokkosTuningInterface.hpp:40
MueLu::KokkosTuningInterface::out_typenames
std::vector< std::string > out_typenames
Definition
MueLu_KokkosTuningInterface.hpp:69
MueLu::KokkosTuningInterface::out_variables
std::vector< Kokkos::Tools::Experimental::VariableValue > out_variables
Definition
MueLu_KokkosTuningInterface.hpp:67
MueLu::KokkosTuningInterface::params_
Teuchos::ParameterList params_
Definition
MueLu_KokkosTuningInterface.hpp:63
MueLu::KokkosTuningInterface::Setup
void Setup()
Definition
MueLu_KokkosTuningInterface.cpp:82
MueLu::KokkosTuningInterface::SplitString
std::vector< std::string > SplitString(const std::string &base_string, const std::string &delimiter) const
Definition
MueLu_KokkosTuningInterface.cpp:183
MueLu::KokkosTuningInterface::comm_
Teuchos::RCP< const Teuchos::Comm< int > > comm_
Definition
MueLu_KokkosTuningInterface.hpp:62
MueLu::KokkosTuningInterface::in_variables
std::vector< Kokkos::Tools::Experimental::VariableValue > in_variables
Definition
MueLu_KokkosTuningInterface.hpp:66
MueLu::KokkosTuningInterface::out_names
std::vector< std::string > out_names
Definition
MueLu_KokkosTuningInterface.hpp:68
MueLu::KokkosTuningInterface::UnpackMueLuMapping
void UnpackMueLuMapping()
Definition
MueLu_KokkosTuningInterface.cpp:91
MueLu::KokkosTuningInterface::GetValidParameterList
Teuchos::RCP< const Teuchos::ParameterList > GetValidParameterList() const
Definition
MueLu_KokkosTuningInterface.cpp:54
MueLu::KokkosTuningInterface::SetMueLuParameters
void SetMueLuParameters(size_t kokkos_context_id, Teuchos::ParameterList &mueluParams, bool overwrite=true) const
Definition
MueLu_KokkosTuningInterface.cpp:202
MueLu::KokkosTuningInterface::~KokkosTuningInterface
virtual ~KokkosTuningInterface()
Definition
MueLu_KokkosTuningInterface.hpp:33
MueLu::KokkosTuningInterface::KokkosTuningInterface
KokkosTuningInterface(const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition
MueLu_KokkosTuningInterface.cpp:49
Teuchos::Comm
Definition
MueLu_Memory.hpp:22
MueLu
Namespace for MueLu classes and methods.
Definition
MueLu_BrickAggregationFactory_decl.hpp:42
src
Utils
MueLu_KokkosTuningInterface.hpp
Generated by
1.17.0