6#ifndef KERNEL_AGGREGATION_INTERFACE_HPP
7#define KERNEL_AGGREGATION_INTERFACE_HPP
30template <
typename T,
typename Host_Allocator,
typename Executor>
37template <
typename Executor>
42template <const
char *kernelname,
class Interface,
class Pool>
48template <const
char* region_name,
typename executor_t,
typename return_type>
50 std::function<return_type(
size_t,
size_t,
52 executor_t>::executor_slice&)> &&aggregation_area) {
55 static hpx::once_flag pool_init;
56 hpx::call_once(pool_init,
58 auto executor_slice_fut = aggregation_pool_t::request_executor_slice();
59 auto ret_fut = executor_slice_fut.value().then(hpx::annotated_function(
60 [aggregation_area](
auto &&fut) {
62 executor_t>::Executor_Slice agg_exec = fut.get();
63 const size_t slice_id = agg_exec.id;
64 const size_t number_slices = agg_exec.number_slices;
65 return aggregation_area(slice_id, number_slices, agg_exec);
Executor Class that aggregates function calls for specific kernels.
Definition aggregation_executors_and_allocators.hpp:408
Definition aggregation_executor_pools.hpp:16
Declaration since the actual allocator is only defined after the Executors.
Definition aggregation_executors_and_allocators.hpp:1003
detail::round_robin_pool_impl< Interface > round_robin_pool_impl
Round robin pool strategy implementation.
Definition executor_pools_interface.hpp:23
void init_area_aggregation_pool(const size_t max_slices)
Definition aggregation_executor_pools.hpp:131
aggregated_executor_modes
Definition aggregation_executors_and_allocators.hpp:397
CPPuddle namespace containing the kernel aggregation functionality.
Definition aggregation_executor_pools.hpp:12
cppuddle::kernel_aggregation::detail::allocator_slice< T, Host_Allocator, Executor > allocator_slice
Definition kernel_aggregation_interface.hpp:31
cppuddle::kernel_aggregation::detail::aggregation_pool< kernelname, Interface, Pool > aggregation_pool
Pool to get an aggregation executor for the desired code region (kernelname).
Definition kernel_aggregation_interface.hpp:43
hpx::future< return_type > aggregation_region(const size_t team_size, std::function< return_type(size_t, size_t, typename cppuddle::kernel_aggregation::detail::aggregated_executor< executor_t >::executor_slice &)> &&aggregation_area)
Start an aggregation region (passsed via lambda).
Definition kernel_aggregation_interface.hpp:49
cppuddle::kernel_aggregation::detail::aggregated_executor_modes aggregated_executor_modes
Definition kernel_aggregation_interface.hpp:25
cppuddle::kernel_aggregation::detail::aggregated_executor< Executor > aggregated_executor
Definition kernel_aggregation_interface.hpp:38