ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ANNContext Struct Reference

#include <Context.h>

Public Member Functions

ANNBindercreate (coco::Block *blk)
 
uint32_t count (void) const
 
ANNBindernth (uint32_t n)
 
const ANNBindernth (uint32_t n) const
 
ANNBinderfind (const coco::Block *blk) const
 

Detailed Description

Definition at line 27 of file Context.h.

Member Function Documentation

◆ count()

uint32_t ANNContext::count ( void  ) const
inline

Definition at line 33 of file Context.h.

33{ return _binders.size(); }

◆ create()

ANNBinder * ANNContext::create ( coco::Block blk)

Definition at line 21 of file Context.cpp.

22{
23 auto mod = std::make_unique<ann::Module>();
24 auto obj = std::make_unique<ANNBinder>(blk, std::move(mod));
25 auto ptr = obj.get();
26
27 _binders.emplace_back(std::move(obj));
28 _map[blk] = ptr;
29
30 return ptr;
31}

◆ find()

ANNBinder * ANNContext::find ( const coco::Block blk) const
inline

Definition at line 40 of file Context.h.

41 {
42 auto it = _map.find(blk);
43
44 if (it == _map.end())
45 {
46 return nullptr;
47 }
48
49 return it->second;
50 }

◆ nth() [1/2]

ANNBinder * ANNContext::nth ( uint32_t  n)
inline

Definition at line 36 of file Context.h.

36{ return _binders.at(n).get(); }

◆ nth() [2/2]

const ANNBinder * ANNContext::nth ( uint32_t  n) const
inline

Definition at line 37 of file Context.h.

37{ return _binders.at(n).get(); }

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