Debian Codegraph @

include/deal.II/base/memory_space.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2018 - 2024 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // Part of the source code is dual licensed under Apache-2.0 WITH
9 // LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10 // governing the source code and code contributions can be found in
11 // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12 //
13 // ------------------------------------------------------------------------
14
15
16 #ifndef dealii_memory_space_h
17 #define dealii_memory_space_h
18
19 #include <deal.II/base/config.h>
20
21 #include <Kokkos_Core.hpp>
22
23 DEAL_II_NAMESPACE_OPEN
24
25 /**
26 */
27 namespace MemorySpace
28 {
29 /**
30 * Structure describing Host memory space.
31 */
32 struct Host
33 {
34 using kokkos_space = ::Kokkos::HostSpace;
35 };
36
37 /**
38 * Structure describing the default memory space. If Kokkos was configured
39 * with a GPU backend, the default memory space is the one corresponding to
40 * that backend. Otherwise, the default memory space is the same as the
41 * Host memory space.
42 */
43 struct Default
44 {
45 using kokkos_space = ::Kokkos::DefaultExecutionSpace::memory_space;
46 };
47 } // namespace MemorySpace
48
49 DEAL_II_NAMESPACE_CLOSE
50
51 #endif