|
|
@ -20,13 +20,11 @@ namespace paddle {
|
|
|
|
namespace memory {
|
|
|
|
namespace memory {
|
|
|
|
namespace detail {
|
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
|
|
|
|
// SystemAllocator is the parent class of CPUAllocator and
|
|
|
|
/**
|
|
|
|
// GPUAllocator. A BuddyAllocator object uses a SystemAllocator*
|
|
|
|
* \brief SystemAllocator is the parent class of CPUAllocator and GPUAllocator.
|
|
|
|
// pointing to the underlying system allocator. An alternative to
|
|
|
|
* A BuddyAllocator object uses a SystemAllocator* pointing to the
|
|
|
|
// this class hierarchy is to pass a system allocator class to
|
|
|
|
* underlying system allocator.
|
|
|
|
// BuddyAllocator as a template parameter. This approach makes
|
|
|
|
*/
|
|
|
|
// BuddyAllocator a class template, and it's very complicated
|
|
|
|
|
|
|
|
// algorithm would make the buddy_allocator.h messy.
|
|
|
|
|
|
|
|
class SystemAllocator {
|
|
|
|
class SystemAllocator {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~SystemAllocator() {}
|
|
|
|
virtual ~SystemAllocator() {}
|
|
|
|