ONE - On-device Neural Engine
|
#include <OpManager.h>
Public Member Functions | |
OpManager (Module *m=nullptr) | |
~OpManager () | |
template<typename T > | |
T * | create (void) |
void | destroy (Op *) |
Destroy (= deallocate) a Op instance. | |
void | destroy_all (Op *) |
Destroy a Op tree. | |
Public Member Functions inherited from coco::PtrManager< Op > | |
uint32_t | size (void) const |
Return the number of managed objects. | |
Op * | at (uint32_t n) const |
Public Member Functions inherited from coco::EntityBuilder | |
virtual | ~EntityBuilder ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from coco::PtrManager< Op > | |
U * | take (std::unique_ptr< U > &&o) |
std::unique_ptr< Op > | release (Op *ptr) |
Protected Member Functions inherited from coco::EntityBuilder | |
Module * | module (void) const |
void | module (Module *m) |
void | modulize (Entity *entity) const |
Definition at line 34 of file OpManager.h.
|
inline |
coco::OpManager::~OpManager | ( | ) |
Definition at line 29 of file OpManager.cpp.
References coco::PtrManager< Op >::at(), destroy_all(), and coco::PtrManager< Op >::size().
T * coco::OpManager::create | ( | void | ) |
Referenced by OpBuilder::load().
void coco::OpManager::destroy | ( | Op * | op | ) |
Destroy (= deallocate) a Op instance.
NOTE destroy(op) WILL NOT update op->parent(). Client SHOULD detach op before destroy(op) call
Definition at line 64 of file OpManager.cpp.
References coco::Op::parent(), and coco::PtrManager< Op >::release().
Referenced by destroy_all().
void coco::OpManager::destroy_all | ( | Op * | op | ) |
Destroy a Op tree.
@require op->parent() == nullptr && op->up() == nullptr
Definition at line 70 of file OpManager.cpp.
References destroy(), coco::Op::parent(), and coco::Op::up().
Referenced by ~OpManager().