ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nest::Module Class Reference

#include <Module.h>

Public Member Functions

 Module ()=default
 
VarContextvar (void)
 
const VarContextvar (void) const
 
DomainContextdomain (void)
 
const DomainContextdomain (void) const
 
const Blockblock (void) const
 
void push (const Expr &expr)
 
const Retret (void) const
 
void ret (const Closure &closure)
 

Detailed Description

Definition at line 28 of file Module.h.

Constructor & Destructor Documentation

◆ Module()

nest::Module::Module ( )
default

Member Function Documentation

◆ block()

const Block & nest::Module::block ( void  ) const
inline

Definition at line 51 of file Module.h.

51{ return _block; }

Referenced by nest::Schedule::block().

◆ domain() [1/2]

DomainContext & nest::Module::domain ( void  )
inline

Definition at line 44 of file Module.h.

44{ return _domain_ctx; }

Referenced by nest::Schedule::domain(), and main().

◆ domain() [2/2]

const DomainContext & nest::Module::domain ( void  ) const
inline

Definition at line 45 of file Module.h.

45{ return _domain_ctx; }

◆ push()

void nest::Module::push ( const Expr expr)

Definition at line 24 of file Module.cpp.

25{
26 auto stmt = std::make_shared<stmt::PushNode>(expr);
27 _block.append(stmt);
28}
void append(const Stmt &stmt)
Definition Block.h:38

References nest::Block::append().

◆ ret() [1/2]

void nest::Module::ret ( const Closure closure)

Definition at line 30 of file Module.cpp.

31{
32 // Only one RET is allowed for each module
33 assert(_ret == nullptr);
34 _ret = std::make_shared<Ret>(clo.id(), clo.sub());
35}

References nest::Closure::id(), and nest::Closure::sub().

◆ ret() [2/2]

const Ret & nest::Module::ret ( void  ) const

Definition at line 37 of file Module.cpp.

38{
39 // Caller should NOT invoke this method before setting ret
40 assert(_ret != nullptr);
41 return *_ret;
42}

Referenced by nest::Schedule::ret().

◆ var() [1/2]

VarContext & nest::Module::var ( void  )
inline

Definition at line 37 of file Module.h.

37{ return _var_ctx; }

Referenced by nest::Schedule::Schedule(), and nest::Schedule::var().

◆ var() [2/2]

const VarContext & nest::Module::var ( void  ) const
inline

Definition at line 38 of file Module.h.

38{ return _var_ctx; }

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