Class Chunk::MemAllocStatus

Nested Relationships

This class is a nested type of Class MemAllocPlan::Chunk.

Class Documentation

class mgb::cg::MemAllocPlan::Chunk::MemAllocStatus

memory allocation status for this chunk

Allocation status can either be INVALID, FROM_OWNER_VAR, or an offset in a static allocation buffer. This status is compactly represented by an integer value. No error check is performed in the accessors.

Note that for static_offset, it is set in SeqMemOptimizer::plan_chunk_allocation() and accessed in VarNodeMemManager::make_static_var_tensor_from_alloc_plan()

Public Functions

bool is_invalid() const

whether memory is not allocated yet

bool is_from_owner_var() const

whether memory comes from owner_var->dev_tensor()

bool is_static_offset() const

whether memory is statically allocated

size_t static_offset() const
void set_invalid()
void set_from_owner_var()
void set_static_offset(size_t offset)