Kokkos Core Kernels Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Kokkos_AnonymousSpace.hpp
1 //@HEADER
2 // ************************************************************************
3 //
4 // Kokkos v. 4.0
5 // Copyright (2022) National Technology & Engineering
6 // Solutions of Sandia, LLC (NTESS).
7 //
8 // Under the terms of Contract DE-NA0003525 with NTESS,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12 // See https://kokkos.org/LICENSE for license information.
13 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //
15 //@HEADER
16 
17 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18 #include <Kokkos_Macros.hpp>
19 static_assert(false,
20  "Including non-public Kokkos header files is not allowed.");
21 #endif
22 #ifndef KOKKOS_ANONYMOUSSPACE_HPP
23 #define KOKKOS_ANONYMOUSSPACE_HPP
24 
25 #include <Kokkos_Core_fwd.hpp>
26 #include <Kokkos_Concepts.hpp>
27 #include <cstddef>
28 
29 /*--------------------------------------------------------------------------*/
30 
31 namespace Kokkos {
32 
33 class AnonymousSpace {
34  public:
36  using memory_space = AnonymousSpace;
37  using execution_space = Kokkos::DefaultExecutionSpace;
38  using size_type = size_t;
39 
41  using device_type = Kokkos::Device<execution_space, memory_space>;
42 
44  AnonymousSpace() = default;
45  AnonymousSpace(AnonymousSpace &&rhs) = default;
46  AnonymousSpace(const AnonymousSpace &rhs) = default;
47  AnonymousSpace &operator=(AnonymousSpace &&) = default;
48  AnonymousSpace &operator=(const AnonymousSpace &) = default;
49  ~AnonymousSpace() = default;
50 
52  static constexpr const char *name() { return "Anonymous"; }
53 };
54 
55 } // namespace Kokkos
56 
57 //----------------------------------------------------------------------------
58 
59 namespace Kokkos {
60 
61 namespace Impl {
62 
63 template <typename OtherSpace>
64 struct MemorySpaceAccess<Kokkos::AnonymousSpace, OtherSpace> {
65  enum : bool { assignable = true };
66  enum : bool { accessible = true };
67  enum : bool { deepcopy = true };
68 };
69 
70 template <typename OtherSpace>
71 struct MemorySpaceAccess<OtherSpace, Kokkos::AnonymousSpace> {
72  enum : bool { assignable = true };
73  enum : bool { accessible = true };
74  enum : bool { deepcopy = true };
75 };
76 
77 template <>
78 struct MemorySpaceAccess<Kokkos::AnonymousSpace, Kokkos::AnonymousSpace> {
79  enum : bool { assignable = true };
80  enum : bool { accessible = true };
81  enum : bool { deepcopy = true };
82 };
83 
84 } // namespace Impl
85 
86 } // namespace Kokkos
87 
88 #endif // #define KOKKOS_ANONYMOUSSPACE_HPP