#include <memory_manager.h>
◆ Allocator()
◆ ~Allocator()
virtual tvm::runtime::memory::Allocator::~Allocator |
( |
| ) |
|
|
virtualdefault |
◆ Alloc() [1/3]
virtual Buffer tvm::runtime::memory::Allocator::Alloc |
( |
Device |
dev, |
|
|
ShapeTuple |
shape, |
|
|
DLDataType |
type_hint, |
|
|
const std::string & |
mem_scope |
|
) |
| |
|
protectedvirtual |
◆ Alloc() [2/3]
virtual Buffer tvm::runtime::memory::Allocator::Alloc |
( |
ShapeTuple |
shape, |
|
|
DLDataType |
type_hint, |
|
|
const std::string & |
mem_scope = "" |
|
) |
| |
|
pure virtual |
Allocate a buffer given a shape and type.
- Parameters
-
shape | The shape of the tensor. |
type_hint | A type hint to the allocator. |
mem_scope | A memory scope of the buffer. |
- Returns
- A sized allocation in the form of a buffer.
◆ Alloc() [3/3]
virtual Buffer tvm::runtime::memory::Allocator::Alloc |
( |
size_t |
nbytes, |
|
|
size_t |
alignment, |
|
|
DLDataType |
type_hint |
|
) |
| |
|
pure virtual |
Allocate a buffer given a size, alignment and type.
- Parameters
-
nbytes | The size of the buffer. |
alignment | The alignment of the buffer. |
type_hint | A type hint to the allocator. |
- Returns
- A sized allocation in the form of a buffer.
◆ Clear()
virtual void tvm::runtime::memory::Allocator::Clear |
( |
| ) |
|
|
virtual |
Clear the allocated memory.
◆ Empty()
Allocate an empty NDArray using from the allocator.
- Parameters
-
shape | The shape of the NDArray. |
dtype | The datatype of the NDArray. |
dev | The device where the array is allocated. |
mem_scope | The device memory scope hint. |
- Returns
- The empty NDArray.
◆ Free()
virtual void tvm::runtime::memory::Allocator::Free |
( |
const Buffer & |
buffer | ) |
|
|
pure virtual |
Free a buffer allocated by the allocator.
- Parameters
-
buffer | The buffer to free. |
◆ type()
Return the allocator type.
◆ UsedMemory()
virtual size_t tvm::runtime::memory::Allocator::UsedMemory |
( |
| ) |
const |
|
pure virtual |
The amount of memory currently allocated.
- Returns
- The amount of memory currently allocated.
The documentation for this class was generated from the following file: