CPPuddle
Namespaces | Classes | Typedefs | Functions
cppuddle::memory_recycling Namespace Reference

CPPuddle namespace containing the memory recycling functionality. More...

Namespaces

 detail
 
 device_selection
 

Classes

struct  cuda_device_buffer
 RAII wrapper for CUDA device memory (ideally used with a recycling allocator) More...
 
struct  cuda_aggregated_device_buffer
 RAII wrapper for CUDA device memory using a passed aggregated allocator (which ideally should be an allocator_slice from the work aggregation) More...
 
struct  hip_device_buffer
 
struct  hip_aggregated_device_buffer
 
struct  view_deleter
 
class  aggregated_recycling_view
 
class  recycling_view
 

Typedefs

template<typename T , std::size_t alignement, std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_aligned = detail::recycle_allocator< T, boost::alignment::aligned_allocator< T, alignement > >
 Recycling allocator for boost aligned memory. More...
 
template<typename T , std::size_t alignement, std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using aggressive_recycle_aligned = detail::aggressive_recycle_allocator< T, boost::alignment::aligned_allocator< T, alignement > >
 Recycling allocator for boost aligned memory (reusing previous content as well) More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_allocator_cuda_host = detail::aggressive_recycle_allocator< T, detail::cuda_pinned_allocator< T > >
 Recycling allocator for CUDA pinned host memory. More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_allocator_cuda_device = detail::recycle_allocator< T, detail::cuda_device_allocator< T > >
 Recycling allocator for CUDA device memory. More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_allocator_hip_host = detail::aggressive_recycle_allocator< T, detail::hip_pinned_allocator< T > >
 Recycling allocator for HIP pinned host memory. More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_allocator_hip_device = detail::recycle_allocator< T, detail::hip_device_allocator< T > >
 Recycling allocator for HIP device memory. More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_std = detail::recycle_allocator< T, std::allocator< T > >
 Recycling allocator for std memory. More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using aggressive_recycle_std = detail::aggressive_recycle_allocator< T, std::allocator< T > >
 Recycling allocator for boost aligned memory (reusing previous content as well) More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_allocator_sycl_host = detail::aggressive_recycle_allocator< T, detail::sycl_host_default_allocator< T > >
 Recycling allocator for SYCL pinned host memory (default device) More...
 
template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using recycle_allocator_sycl_device = detail::recycle_allocator< T, detail::sycl_device_default_allocator< T > >
 Recycling allocator for SYCL device memory (default device) More...
 

Functions

void print_buffer_counters ()
 Print performance counters of all buffer managers to stdout. More...
 
void force_buffer_cleanup ()
 
void unused_buffer_cleanup ()
 Deletes all buffers currently marked as unused. More...
 
void finalize ()
 

Detailed Description

CPPuddle namespace containing the memory recycling functionality.

Typedef Documentation

◆ aggressive_recycle_aligned

template<typename T , std::size_t alignement, std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::aggressive_recycle_aligned = typedef detail::aggressive_recycle_allocator< T, boost::alignment::aligned_allocator<T, alignement> >

Recycling allocator for boost aligned memory (reusing previous content as well)

◆ aggressive_recycle_std

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::aggressive_recycle_std = typedef detail::aggressive_recycle_allocator<T, std::allocator<T> >

Recycling allocator for boost aligned memory (reusing previous content as well)

◆ recycle_aligned

template<typename T , std::size_t alignement, std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_aligned = typedef detail::recycle_allocator< T, boost::alignment::aligned_allocator<T, alignement> >

Recycling allocator for boost aligned memory.

◆ recycle_allocator_cuda_device

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_allocator_cuda_device = typedef detail::recycle_allocator<T, detail::cuda_device_allocator<T> >

Recycling allocator for CUDA device memory.

◆ recycle_allocator_cuda_host

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_allocator_cuda_host = typedef detail::aggressive_recycle_allocator<T, detail::cuda_pinned_allocator<T> >

Recycling allocator for CUDA pinned host memory.

◆ recycle_allocator_hip_device

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_allocator_hip_device = typedef detail::recycle_allocator<T, detail::hip_device_allocator<T> >

Recycling allocator for HIP device memory.

◆ recycle_allocator_hip_host

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_allocator_hip_host = typedef detail::aggressive_recycle_allocator<T, detail::hip_pinned_allocator<T> >

Recycling allocator for HIP pinned host memory.

◆ recycle_allocator_sycl_device

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_allocator_sycl_device = typedef detail::recycle_allocator<T, detail::sycl_device_default_allocator<T> >

Recycling allocator for SYCL device memory (default device)

◆ recycle_allocator_sycl_host

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_allocator_sycl_host = typedef detail::aggressive_recycle_allocator<T, detail::sycl_host_default_allocator<T> >

Recycling allocator for SYCL pinned host memory (default device)

◆ recycle_std

template<typename T , std::enable_if_t< std::is_trivial< T >::value, int > = 0>
using cppuddle::memory_recycling::recycle_std = typedef detail::recycle_allocator<T, std::allocator<T> >

Recycling allocator for std memory.

Function Documentation

◆ finalize()

void cppuddle::memory_recycling::finalize ( )
inline

Deletes all buffers (even ones still marked as used), delete the buffer managers and the recycler itself. Disallows further usage.

◆ force_buffer_cleanup()

void cppuddle::memory_recycling::force_buffer_cleanup ( )
inline

Deletes all buffers (even ones still marked as used), delete the buffer managers and the recycler itself

◆ print_buffer_counters()

void cppuddle::memory_recycling::print_buffer_counters ( )
inline

Print performance counters of all buffer managers to stdout.

◆ unused_buffer_cleanup()

void cppuddle::memory_recycling::unused_buffer_cleanup ( )
inline

Deletes all buffers currently marked as unused.