Utils¶
Memory Handle¶
- 
namespace 
paddle¶ Typedefs
- 
typedef std::shared_ptr<MemoryHandle> 
MemoryHandlePtr¶ 
- 
typedef std::shared_ptr<CpuMemoryHandle> 
CpuMemHandlePtr¶ 
- 
typedef std::shared_ptr<GpuMemoryHandle> 
GpuMemHandlePtr¶ 
- 
class 
MemoryHandle¶ Subclassed by paddle::CpuMemoryHandle, paddle::GpuMemoryHandle
- 
class 
GpuMemoryHandle¶ - #include <MemoryHandle.h>
Wrapper class for raw gpu memory handle.
The raw handle will be released at destructor
Inherits from paddle::MemoryHandle
 
- 
class 
CpuMemoryHandle¶ - #include <MemoryHandle.h>
Wrapper class for raw cpu memory handle.
The raw handle will be released at destructor
Inherits from paddle::MemoryHandle
 
- 
typedef std::shared_ptr<MemoryHandle> 
 
- 
namespace 
paddle¶ - 
class 
Allocator¶ - #include <Allocator.h>
Allocator base class.
This is the base class of all Allocator class.
Subclassed by paddle::CpuAllocator, paddle::CudaHostAllocator, paddle::GpuAllocator
 
- 
class 
CpuAllocator¶ - #include <Allocator.h>
CPU allocator implementation.
Inherits from paddle::Allocator
 
- 
class 
GpuAllocator¶ - #include <Allocator.h>
GPU allocator implementation.
Inherits from paddle::Allocator
 
- 
class 
CudaHostAllocator¶ - #include <Allocator.h>
CPU pinned memory allocator implementation.
Inherits from paddle::Allocator
 
- 
class 
 
- 
namespace 
paddle - 
class 
PoolAllocator¶ - #include <PoolAllocator.h>
Memory pool allocator implementation.
Public Functions
- 
PoolAllocator(Allocator *allocator, size_t sizeLimit = 0, const std::string &name = "pool")¶ constructor.
- Parameters
 allocator-a Allocator object.
sizeLimit-The maximum size memory can be managed, if sizeLimit == 0, the pool allocator is a simple wrapper of allocator.
- 
~PoolAllocator()¶ destructor.
- 
void *
alloc(size_t size)¶ 
- 
void 
free(void *ptr, size_t size)¶ 
- 
std::string 
getName()¶ 
 - 
 
- 
class 
 
- 
namespace 
paddle - 
class 
StorageEngine¶ - #include <Storage.h>
Storage manager for multiple devices.
Public Functions
- 
PoolAllocator *
getGpuAllocator(int deviceId)¶ - Return
 - return one gpu allocator by deviceId
 
- 
PoolAllocator *
getCpuAllocator()¶ - Return
 - return cpu allocator
 
Public Static Functions
- 
StorageEngine *
singleton()¶ - Return
 - Storage singleton
 
 - 
PoolAllocator *
 
- 
class