3#include <boost/pool/pool.hpp>
5#ifdef APRA_CUDA_ENABLED
7 #include "apra_cudamallochost_allocator.h"
8 #include "apra_cudamalloc_allocator.h"
38#ifdef APRA_CUDA_ENABLED
42 boost::pool<apra_cudamallochost_allocator> buff_pinned_allocator;
45 HostPinnedAllocator() : buff_pinned_allocator(1024) {};
46 ~HostPinnedAllocator()
48 buff_pinned_allocator.release_memory();
52 return buff_pinned_allocator.ordered_malloc(n);
56 buff_pinned_allocator.ordered_free(MemPtr, n);
63 ApraPool<apra_cudamalloc_allocator> buff_cudadevice_allocator;
66 CudaDeviceAllocator() : buff_cudadevice_allocator(1024) {};
67 ~CudaDeviceAllocator()
void ordered_free(void *ptr, const size_t n)
Definition ApraPool.h:378
bool release_memory()
Definition ApraPool.h:197
void * ordered_malloc(const size_t n)
Definition ApraPool.h:300
Definition Allocators.h:12
virtual size_t getChunkSize()
Definition Allocators.h:32
boost::pool buff_allocator
Definition Allocators.h:14
HostAllocator()
Definition Allocators.h:17
virtual void freeChunks(void *MemPtr, size_t n)
Definition Allocators.h:27
virtual void * allocateChunks(size_t n)
Definition Allocators.h:22
virtual ~HostAllocator()
Definition Allocators.h:18