1 #ifndef DASH__MEMORY__MEMORY_SPACE_H__INCLUDED 2 #define DASH__MEMORY__MEMORY_SPACE_H__INCLUDED 4 #include <dash/memory/HBWSpace.h> 5 #include <dash/memory/HostSpace.h> 7 #include <dash/memory/GlobLocalMemoryPool.h> 8 #include <dash/memory/GlobStaticMem.h> 10 #include <dash/GlobPtr.h> 22 template <
class,
class>
23 struct dependent_false : std::false_type {
27 template <
class MSpaceDomainCategory,
class MSpaceTypeCategory>
28 inline MemorySpace<MSpaceDomainCategory, MSpaceTypeCategory>*
32 detail::dependent_false<MSpaceDomainCategory, MSpaceTypeCategory>::
34 "No default memory space for this configuration available");
41 get_default_memory_space<memory_domain_local, memory_space_host_tag>();
45 get_default_memory_space<memory_domain_local, memory_space_hbw_tag>();
49 get_default_memory_space<memory_domain_global, memory_space_host_tag>();
60 DASH_ASSERT_MSG(mspace,
"invalid default memory space");
62 auto ptr = mspace->allocate(nelem *
sizeof(T),
alignof(T));
77 DASH_ASSERT_MSG(mspace,
"invalid default memory space");
79 mspace->deallocate(gptr, nels *
sizeof(T),
alignof(T));
MemorySpace< MSpaceDomainCategory, MSpaceTypeCategory > * get_default_memory_space()
Forward declarations.
This class is a simple memory pool which holds allocates elements of size ValueType.
The MemorySpace concept follows the STL std::pmr::memory_resource.
Pointer in global memory space with random access arithmetics.
decltype(dash::memalloc< T >(size_t{})) GlobMemAllocPtr
Convenience Wrapper to retrieve easily the type allocated by dash::memalloc<T>