ONE - On-device Neural Engine
Loading...
Searching...
No Matches
enco::MemoryContext Class Reference

Record C/C++ expression that denotes the base and size of memory region dedicated to each bag. More...

#include <MemoryContext.h>

Public Member Functions

bool member (const coco::Bag *bag) const
 Check whether a base/size expression for a given bag.
 
void base (const coco::Bag *bag, const std::string &exp)
 
void size (const coco::Bag *bag, const std::string &exp)
 
const std::string & base (const coco::Bag *bag) const
 
const std::string & size (const coco::Bag *bag) const
 

Detailed Description

Record C/C++ expression that denotes the base and size of memory region dedicated to each bag.

Definition at line 32 of file MemoryContext.h.

Member Function Documentation

◆ base() [1/2]

const std::string & enco::MemoryContext::base ( const coco::Bag bag) const
inline

Definition at line 45 of file MemoryContext.h.

45{ return _base.at(bag); }

◆ base() [2/2]

void enco::MemoryContext::base ( const coco::Bag bag,
const std::string &  exp 
)

Definition at line 37 of file MemoryContext.cpp.

37{ _base[bag] = exp; }

Referenced by enco::CppCode::dump().

◆ member()

bool enco::MemoryContext::member ( const coco::Bag bag) const

Check whether a base/size expression for a given bag.

Definition at line 24 of file MemoryContext.cpp.

25{
26 // NOTE _base and _size SHOULD BE consistent
27 if (_base.find(bag) != _base.end())
28 {
29 assert(_size.find(bag) != _size.end());
30 return true;
31 }
32
33 assert(_size.find(bag) == _size.end());
34 return false;
35}

Referenced by enco::CppCode::dump().

◆ size() [1/2]

const std::string & enco::MemoryContext::size ( const coco::Bag bag) const
inline

Definition at line 46 of file MemoryContext.h.

46{ return _size.at(bag); }

◆ size() [2/2]

void enco::MemoryContext::size ( const coco::Bag bag,
const std::string &  exp 
)

Definition at line 38 of file MemoryContext.cpp.

38{ _size[bag] = exp; }

Referenced by enco::CppCode::dump().


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