#include "coco/IR/Instr.h"
#include "coco/IR/Op.forward.h"
+#include "coco/IR/Object.forward.h"
+#include "coco/IR/ObjectInfo.forward.h"
+
#include "coco/ADT/PtrManager.h"
#include "coco/ADT/PtrLink.h"
class InstrManager final : public PtrManager<Instr>
{
public:
- InstrManager(PtrLink<Op, Instr> *op_link, const PtrLink<Instr, Block> *instr_link)
- : _op_link{op_link}, _instr_link{instr_link}
+ InstrManager(PtrLink<Op, Instr> *op_link, const PtrLink<Instr, Block> *instr_link,
+ const PtrLink<Object, ObjectInfo> *obj_link)
+ : _op_link{op_link}, _instr_link{instr_link}, _obj_link{obj_link}
{
// DO NOTHING
}
private:
PtrLink<Op, Instr> *const _op_link;
const PtrLink<Instr, Block> *const _instr_link;
+ const PtrLink<Object, ObjectInfo> *const _obj_link;
};
} // namespace coco
#include "coco/IR/Op.h"
#include "coco/IR/Instr.forward.h"
+#include "coco/IR/Object.forward.h"
+#include "coco/IR/ObjectInfo.forward.h"
+
#include "coco/ADT/PtrManager.h"
#include "coco/ADT/PtrLink.h"
struct OpManager : public PtrManager<Op>
{
public:
- OpManager(const PtrLink<Op, Instr> *op_link);
+ OpManager(const PtrLink<Op, Instr> *op_link, const PtrLink<Object, ObjectInfo> *obj_link);
public:
Conv2D *create(const Conv2D::Param &);
private:
const PtrLink<Op, Instr> *const _op_link;
+ const PtrLink<Object, ObjectInfo> *const _obj_link;
};
} // namespace coco
coco::PtrLink<coco::Instr, coco::Block> link;
coco::ObjectManager obj_mgr{&obj_link, &bag_link};
- coco::OpManager op_mgr{&op_link};
+ coco::OpManager op_mgr{&op_link, &obj_link};
};
} // namespace
{
coco::PtrLink<coco::Op, coco::Instr> op_link;
coco::PtrLink<coco::Instr, coco::Block> link;
- coco::InstrManager mgr{&op_link, &link};
+ coco::PtrLink<coco::Object, coco::ObjectInfo> obj_link;
+ coco::InstrManager mgr{&op_link, &link, &obj_link};
// Conv2D
{
mgr->_bag = nncc::foundation::make_unique<coco::BagManager>(bag_link.get());
mgr->_object =
nncc::foundation::make_unique<coco::ObjectManager>(obj_link.get(), bag_link.get());
- mgr->_op = nncc::foundation::make_unique<coco::OpManager>(op_link.get());
- mgr->_instr = nncc::foundation::make_unique<coco::InstrManager>(op_link.get(), ins_link.get());
+ mgr->_op = nncc::foundation::make_unique<coco::OpManager>(op_link.get(), obj_link.get());
+ mgr->_instr = nncc::foundation::make_unique<coco::InstrManager>(op_link.get(), ins_link.get(),
+ obj_link.get());
mgr->_block = nncc::foundation::make_unique<coco::BlockManager>(blk_link.get(), ins_link.get());
mgr->_input = nncc::foundation::make_unique<coco::InputManager>(bag_link.get());
mgr->_output = nncc::foundation::make_unique<coco::OutputManager>(bag_link.get());
namespace coco
{
-OpManager::OpManager(const PtrLink<Op, Instr> *op_link) : _op_link{op_link}
+OpManager::OpManager(const PtrLink<Op, Instr> *op_link, const PtrLink<Object, ObjectInfo> *obj_link)
+ : _op_link{op_link}, _obj_link{obj_link}
{
// DO NOTHING
}
TEST(IR_OP_MANAGER, create_Conv2D)
{
coco::PtrLink<coco::Op, coco::Instr> op_link;
- coco::OpManager mgr{&op_link};
+ coco::PtrLink<coco::Object, coco::ObjectInfo> obj_link;
+ coco::OpManager mgr{&op_link, &obj_link};
coco::Conv2D::Param param;
auto obj = mgr.create(param);