Skip to content

Commit

Permalink
Revert "Add aggregation view convenience wrapper"
Browse files Browse the repository at this point in the history
This reverts commit e5fc59a.
  • Loading branch information
G-071 committed Jul 28, 2024
1 parent e5fc59a commit b0226c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
16 changes: 10 additions & 6 deletions examples/kernel-aggregation-with-hpx-kokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ using host_allocator_t = cppuddle::memory_recycling::recycle_allocator_sycl_host
#else
#error "Example assumes both a host and a device Kokkos execution space are available"
#endif


// Plug together the defined Kokkos views with the recycling CPPuddle allocators
// This yields a new type that can be used just like a normal Kokkos View but gets its memory from
// CPPuddle.
Expand All @@ -105,11 +103,17 @@ using recycling_host_view_t =
cppuddle::memory_recycling::recycling_view<kokkos_host_view_t,
host_allocator_t, float_t>;
using aggregated_device_view_t =
cppuddle::kernel_aggregation::aggregated_recycling_view<
kokkos_device_view_t, device_allocator_t, float_t, device_executor_t>;
cppuddle::memory_recycling::aggregated_recycling_view<
kokkos_device_view_t,
cppuddle::kernel_aggregation::allocator_slice<
float_t, device_allocator_t, device_executor_t>,
float_t>;
using aggregated_host_view_t =
cppuddle::kernel_aggregation::aggregated_recycling_view<
kokkos_host_view_t, host_allocator_t, float_t, device_executor_t>;
cppuddle::memory_recycling::aggregated_recycling_view<
kokkos_host_view_t,
cppuddle::kernel_aggregation::allocator_slice<float_t, host_allocator_t,
device_executor_t>,
float_t>;

// Run host kernels on HPX execution space:
using host_executor_t = hpx::kokkos::hpx_executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <hpx/kokkos.hpp>

#include <cppuddle/executor_recycling/executor_pools_interface.hpp>
#include <cppuddle/memory_recycling/util/recycling_kokkos_view.hpp>
#include <aggregation_manager.hpp>
#ifdef __NVCC__
#include <cuda/std/tuple>
Expand Down Expand Up @@ -192,13 +191,6 @@ hpx::shared_future<void> aggregrated_deep_copy_async(
agg_exec.get_underlying_executor());
}

template <typename kokkos_view_t, typename alloc_t, typename data_t, typename executor_t>
using aggregated_recycling_view = cppuddle::memory_recycling::detail::aggregated_recycling_view<
kokkos_view_t,
cppuddle::kernel_aggregation::allocator_slice<data_t, alloc_t,
executor_t>,
data_t>;

} // namespace kernel_aggregation
} // namespace cppuddle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace cppuddle {
namespace memory_recycling {
namespace detail{

/// Convienience struct to delete the view once the reference counting
/// reaches 0
Expand Down Expand Up @@ -95,7 +94,6 @@ class aggregated_recycling_view : public kokkos_type {
~aggregated_recycling_view() {}
};

} // namespace detail

/// Kokkos View that automatically uses a recycling allocator using
/// alloc_type as an underlying allocator
Expand All @@ -119,7 +117,7 @@ class recycling_view : public kokkos_type {
args...),
total_elements(kokkos_type::required_allocation_size(args...) /
sizeof(element_type)),
data_ref_counter(this->data(), detail::view_deleter<element_type, alloc_type>(
data_ref_counter(this->data(), view_deleter<element_type, alloc_type>(
alloc_type{}, total_elements)) {}

template <typename... Args,
Expand All @@ -131,7 +129,7 @@ class recycling_view : public kokkos_type {
args...),
total_elements(kokkos_type::required_allocation_size(args...) /
sizeof(element_type)),
data_ref_counter(this->data(), detail::view_deleter<element_type, alloc_type>(
data_ref_counter(this->data(), view_deleter<element_type, alloc_type>(
alloc_type{device_id}, total_elements)) {}

template <
Expand All @@ -144,7 +142,7 @@ class recycling_view : public kokkos_type {
layout),
total_elements(kokkos_type::required_allocation_size(layout) /
sizeof(element_type)),
data_ref_counter(this->data(), detail::view_deleter<element_type, alloc_type>(
data_ref_counter(this->data(), view_deleter<element_type, alloc_type>(
alloc_type{device_id}, total_elements)) {}

recycling_view(
Expand Down
3 changes: 1 addition & 2 deletions include/kokkos_buffer_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ template <typename kokkos_type, typename alloc_type, typename element_type>
using aggregated_recycled_view [[deprecated(
"Use aggregated_recycle_view from header recycling_kokkos_view.hpp "
"instead")]] =
cppuddle::memory_recycling::detail::aggregated_recycling_view<
kokkos_type, alloc_type, element_type>;
cppuddle::memory_recycling::aggregated_recycling_view<kokkos_type, alloc_type, element_type>;

template <typename kokkos_type, typename alloc_type, typename element_type>
using recycled_view [[deprecated(
Expand Down

0 comments on commit b0226c9

Please sign in to comment.