version 3.8
multithreading.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
13#ifndef DUMUX_PARALLEL_MULTITHREADING_HH
14#define DUMUX_PARALLEL_MULTITHREADING_HH
15
16#include <type_traits>
17
18#ifndef DUMUX_MULTITHREADING_BACKEND
19#define DUMUX_MULTITHREADING_BACKEND Serial
20#endif
21
23
24namespace ExecutionBackends {
25
26struct Serial {};
27struct Cpp {};
28struct TBB {};
29struct Kokkos {};
30struct OpenMP {};
31
32} // end namespace ExecutionBackends
33
34// set the execution backend type
36
37} // end namespace Dumux::Detail::Multithreading
38
40
45inline constexpr bool isSerial()
46{
47 using namespace Dumux::Detail::Multithreading;
48 return std::is_same_v<ExecutionBackends::Serial, ExecutionBackend>;
49};
50
51} // end namespace Dumux
52
53#endif
constexpr bool isSerial()
Checking whether the backend is serial.
Definition: multithreading.hh:45
#define DUMUX_MULTITHREADING_BACKEND
Definition: multithreading.hh:19
Definition: multithreading.hh:22
ExecutionBackends::DUMUX_MULTITHREADING_BACKEND ExecutionBackend
Definition: multithreading.hh:35
Definition: multithreading.hh:39