13 #ifndef HTGS_CUDAMEMORYMANAGER_HPP 14 #define HTGS_CUDAMEMORYMANAGER_HPP 19 #include <cuda_runtime_api.h> 53 MemoryManager<T>(name, memoryPoolSize, memoryAllocator, type) {
55 if (type != MMType::Static)
57 std::cerr <<
"WARNING: The CudaMemoryManagers " << name <<
" should use Static memory allocation to avoid " 58 "unnecessary GPU synchronization" << std::endl;
99 #endif //HTGS_CUDAMEMORYMANAGER_HPP MemoryManager< T > * copy() override
Creates a shallow copy of the CudaMemoryManager.
Definition: CudaMemoryManager.hpp:85
std::string getMemoryManagerName()
Gets the name of the memory manager.
Definition: MemoryManager.hpp:197
Implements a MemoryManager that binds the thread responsible for the MemoryManager to a CUDA GPU prio...
Definition: CudaMemoryManager.hpp:34
size_t memoryPoolSize
The size of the memory pool.
Definition: MemoryManager.hpp:258
MMType
The memory manager types.
Definition: MMType.hpp:38
int * cudaIds
The array of CUDA contexts.
Definition: CudaMemoryManager.hpp:94
virtual size_t getMemoryPoolSize()
Virtual function to gets the size of the MemoryPool.
Definition: MemoryManager.hpp:180
std::string name
The name of the memory manager.
Definition: MemoryManager.hpp:260
void initialize() override
Initializes the CudaMemoryManager by setting which GPU the CudaMemoryManager is repsonsible prior to ...
Definition: CudaMemoryManager.hpp:68
std::string getName() override
Gets the name of the CudaMemoryManager.
Definition: CudaMemoryManager.hpp:77
size_t getPipelineId()
Gets the pipeline ID.
Definition: AnyITask.hpp:367
virtual std::string getName() override
Gets the name of the MemoryManager.
Definition: MemoryManager.hpp:155
void initialize() override
Initializes the MemoryManager, getting the size of the memory pool, and filling the memory pool with ...
Definition: MemoryManager.hpp:87
Processes MemoryData between two ITasks using a memory pool.
Definition: MemoryManager.hpp:47
Abstract class that describes how memory is allocated and freed.
Definition: IMemoryAllocator.hpp:67
MMType getType() const
Gets the memory manager type.
Definition: MemoryManager.hpp:221
MMType type
The memory manager type.
Definition: MemoryManager.hpp:261
virtual std::shared_ptr< IMemoryAllocator< T > > getAllocator()
Gets the allocator that is responsible for allocating and freeing memory for the MemoryPool.
Definition: MemoryManager.hpp:188
CudaMemoryManager(std::string name, int *cudaIds, size_t memoryPoolSize, std::shared_ptr< IMemoryAllocator< T >> memoryAllocator, MMType type)
Creates a CudaMemoryManager.
Definition: CudaMemoryManager.hpp:48
Implements the MemoryManager class that processes MemoryData between two ITasks.
Definition: Bookkeeper.hpp:23
Defines how memory is allocated and freed.