17#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18#include <Kokkos_Macros.hpp>
20 "Including non-public Kokkos header files is not allowed.");
22#ifndef KOKKOS_HOSTSPACE_HPP
23#define KOKKOS_HOSTSPACE_HPP
30#include <Kokkos_Core_fwd.hpp>
31#include <Kokkos_Concepts.hpp>
32#include <Kokkos_MemoryTraits.hpp>
34#include <impl/Kokkos_Traits.hpp>
35#include <impl/Kokkos_Error.hpp>
36#include <impl/Kokkos_SharedAlloc.hpp>
37#include <impl/Kokkos_Tools.hpp>
39#include "impl/Kokkos_HostSpace_deepcopy.hpp"
73#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
77#if defined(KOKKOS_COMPILER_GNU) && KOKKOS_COMPILER_GNU < 1100
82 enum KOKKOS_DEPRECATED
96 template <
typename ExecutionSpace>
100 template <
typename ExecutionSpace>
106 void*
allocate(
const size_t arg_alloc_size)
const;
107 void*
allocate(
const char* arg_label,
const size_t arg_alloc_size,
108 const size_t arg_logical_size = 0)
const;
118 const Kokkos::Tools::SpaceHandle =
119 Kokkos::Tools::make_space_handle(
name()))
const;
123 const Kokkos::Tools::SpaceHandle =
124 Kokkos::Tools::make_space_handle(
name()))
const;
127 static constexpr const char*
name() {
return m_name; }
130 static constexpr const char* m_name =
"Host";
151 typename S::execution_space::memory_space,
160 typename S::memory_space>::accessible
164 using Space = std::conditional_t<
165 keep_exe && keep_mem, S,
166 std::conditional_t<keep_mem,
168 typename S::memory_space>,
186template <
class ExecutionSpace>
187struct DeepCopy<HostSpace, HostSpace, ExecutionSpace> {
188 DeepCopy(
void* dst,
const void* src,
size_t n) {
189 hostspace_parallel_deepcopy(dst, src, n);
192 DeepCopy(
const ExecutionSpace& exec,
void* dst,
const void* src,
size_t n) {
196 "Kokkos::Impl::DeepCopy<HostSpace, HostSpace, "
197 "ExecutionSpace>::DeepCopy: fence before copy");
198 hostspace_parallel_deepcopy_async(dst, src, n);
200 hostspace_parallel_deepcopy_async(exec, dst, src, n);
A thread safe view to a bitset.
Memory management for host memory.
void * allocate(const ExecutionSpace &, const size_t arg_alloc_size) const
Allocate untracked memory in the space.
static constexpr const char * name()
Return Name of the MemorySpace.
void deallocate(void *const arg_alloc_ptr, const size_t arg_alloc_size) const
Deallocate untracked memory in the space.
DefaultHostExecutionSpace execution_space
Default execution space for this memory space.
Access relationship between DstMemorySpace and SrcMemorySpace.
Can AccessSpace access MemorySpace ?