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

#include <memory_manager.h>

Collaboration diagram for tvm::runtime::memory::MemoryManager:

Static Public Member Functions

static TVM_RUNTIME_DLL MemoryManagerGlobal ()
 
static TVM_RUNTIME_DLL AllocatorGetOrCreateAllocator (Device dev, AllocatorType type)
 Get or create an allocator given the context and allocator type. More...
 
static TVM_RUNTIME_DLL AllocatorGetAllocator (Device dev, AllocatorType type)
 Get an allocator given the context. More...
 
static void Clear ()
 Clear the allocators. More...
 

Protected Attributes

std::mutex mu_
 
std::unordered_map< Device, std::unordered_map< AllocatorType, std::unique_ptr< Allocator > > > allocators_
 

Member Function Documentation

◆ Clear()

static void tvm::runtime::memory::MemoryManager::Clear ( )
static

Clear the allocators.

◆ GetAllocator()

static TVM_RUNTIME_DLL Allocator* tvm::runtime::memory::MemoryManager::GetAllocator ( Device  dev,
AllocatorType  type 
)
static

Get an allocator given the context.

Parameters
devThe TVM device
typeThe allocator type
Returns
The memory allocator.

◆ GetOrCreateAllocator()

static TVM_RUNTIME_DLL Allocator* tvm::runtime::memory::MemoryManager::GetOrCreateAllocator ( Device  dev,
AllocatorType  type 
)
static

Get or create an allocator given the context and allocator type.

Parameters
devThe TVM device
typeThe allocator type
Returns
The memory allocator.

◆ Global()

static TVM_RUNTIME_DLL MemoryManager* tvm::runtime::memory::MemoryManager::Global ( )
static

Member Data Documentation

◆ allocators_

std::unordered_map<Device, std::unordered_map<AllocatorType, std::unique_ptr<Allocator> > > tvm::runtime::memory::MemoryManager::allocators_
protected

◆ mu_

std::mutex tvm::runtime::memory::MemoryManager::mu_
protected

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