tvm
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::runtime::memory::StorageObj Class Reference

An object representing a storage allocation. More...

#include <memory_manager.h>

Inheritance diagram for tvm::runtime::memory::StorageObj:
Collaboration diagram for tvm::runtime::memory::StorageObj:

Public Member Functions

NDArray AllocNDArray (int64_t offset, ffi::Shape shape, DLDataType dtype)
 Allocate an NDArray from a given piece of storage. More...
 
NDArray AllocNDArrayScoped (int64_t offset, ffi::Shape shape, DLDataType dtype, String scope="global")
 Allocate an NDArray with memory scope from a given piece of storage. More...
 
 ~StorageObj ()
 
 TVM_DECLARE_FINAL_OBJECT_INFO (StorageObj, Object)
 

Public Attributes

Buffer buffer
 The index into the VM function table. More...
 
Allocatorallocator = nullptr
 The allocator where the storage buffer is allocated from. More...
 

Static Public Attributes

static constexpr const char * _type_key = "vm.Storage"
 

Detailed Description

An object representing a storage allocation.

Constructor & Destructor Documentation

◆ ~StorageObj()

tvm::runtime::memory::StorageObj::~StorageObj ( )
inline

Member Function Documentation

◆ AllocNDArray()

NDArray tvm::runtime::memory::StorageObj::AllocNDArray ( int64_t  offset,
ffi::Shape  shape,
DLDataType  dtype 
)

Allocate an NDArray from a given piece of storage.

◆ AllocNDArrayScoped()

NDArray tvm::runtime::memory::StorageObj::AllocNDArrayScoped ( int64_t  offset,
ffi::Shape  shape,
DLDataType  dtype,
String  scope = "global" 
)

Allocate an NDArray with memory scope from a given piece of storage.

◆ TVM_DECLARE_FINAL_OBJECT_INFO()

tvm::runtime::memory::StorageObj::TVM_DECLARE_FINAL_OBJECT_INFO ( StorageObj  ,
Object   
)

Member Data Documentation

◆ _type_key

constexpr const char* tvm::runtime::memory::StorageObj::_type_key = "vm.Storage"
staticconstexpr

◆ allocator

Allocator* tvm::runtime::memory::StorageObj::allocator = nullptr

The allocator where the storage buffer is allocated from.

◆ buffer

Buffer tvm::runtime::memory::StorageObj::buffer

The index into the VM function table.


The documentation for this class was generated from the following file: