ginkgo/core/distributed/base.hpp Source File

ginkgo/core/distributed/base.hpp Source File#

Reference API: ginkgo/core/distributed/base.hpp Source File
Reference API
base.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_BASE_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_BASE_HPP_
7
8
9#include <ginkgo/config.hpp>
10
11
12#if GINKGO_BUILD_MPI
13
14
15#include <ginkgo/core/base/mpi.hpp>
16
17
18namespace gko {
19namespace experimental {
20namespace distributed {
21
22
33public:
34 virtual ~DistributedBase() = default;
35
36 DistributedBase(const DistributedBase& other) = default;
37
38 DistributedBase(DistributedBase&& other) = default;
39
44 DistributedBase& operator=(const DistributedBase&) { return *this; }
45
50 DistributedBase& operator=(DistributedBase&&) noexcept { return *this; }
51
56 mpi::communicator get_communicator() const { return comm_; }
57
58protected:
63 explicit DistributedBase(mpi::communicator comm) : comm_{std::move(comm)} {}
64
65private:
67};
68
69
70} // namespace distributed
71} // namespace experimental
72} // namespace gko
73
74
75#endif // GINKGO_BUILD_MPI
76
77
78#endif // GKO_PUBLIC_CORE_DISTRIBUTED_BASE_HPP_
DistributedBase & operator=(const DistributedBase &)
Definition base.hpp:44
DistributedBase & operator=(DistributedBase &&) noexcept
Definition base.hpp:50
DistributedBase(mpi::communicator comm)
Definition base.hpp:63
mpi::communicator get_communicator() const
Definition base.hpp:56
The Ginkgo namespace.
Definition abstract_factory.hpp:20
STL namespace.