hpx/compute/host/block_allocator.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
compute
-
namespace
host
¶ -
template<typename
T
, typenameExecutor
= hpx::parallel::execution::restricted_thread_pool_executor>
structblock_allocator
: public hpx::compute::host::detail::policy_allocator<T, hpx::execution::parallel_policy_shim<block_executor<hpx::parallel::execution::restricted_thread_pool_executor>, block_executor<hpx::parallel::execution::restricted_thread_pool_executor>::executor_parameters_type>>¶ - #include <block_allocator.hpp>
The block_allocator allocates blocks of memory evenly divided onto the passed vector of targets. This is done by using first touch memory placement.
This allocator can be used to write NUMA aware algorithms:
using allocator_type = hpx::compute::host::block_allocator<int>; using vector_type = hpx::compute::vector<int, allocator_type>;
auto numa_nodes = hpx::compute::host::numa_domains(); std::size_t N = 2048; vector_type v(N, allocator_type(numa_nodes));
Public Types
-
template<>
usingexecutor_type
= block_executor<Executor>¶
-
template<>
usingexecutor_parameters_type
= typename executor_type::executor_parameters_type¶
-
template<>
usingpolicy_type
= hpx::execution::parallel_policy_shim<executor_type, executor_parameters_type>¶
-
template<>
usingbase_type
= detail::policy_allocator<T, policy_type>¶
-
template<>
-
template<typename
-
namespace
-
namespace