#include "coco/IR/Input.h"
#include "coco/ADT/PtrManager.h"
+#include "coco/ADT/PtrLink.h"
namespace coco
{
struct InputManager final : public PtrManager<Input>
{
+public:
+ InputManager(const PtrLink<Bag, BagInfo> *bag_link) : _bag_link{bag_link}
+ {
+ // DO NOTHING
+ }
+
+public:
Input *make(const nncc::core::ADT::tensor::Shape &);
+
+private:
+ const PtrLink<Bag, BagInfo> * const _bag_link;
};
} // namespace coco
TEST(IR_INPUT_MANAGER, make)
{
- const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1};
-
- coco::InputManager mgr;
+ const coco::PtrLink<coco::Bag, coco::BagInfo> bag_link;
+ coco::InputManager mgr{&bag_link};
+ const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1};
auto input = mgr.make(shape);
ASSERT_EQ(input->shape(), shape);
mgr->_op = nncc::foundation::make_unique<coco::OpManager>();
mgr->_instr = nncc::foundation::make_unique<coco::InstrManager>(ins_link.get());
mgr->_block = nncc::foundation::make_unique<coco::BlockManager>(blk_link.get(), ins_link.get());
- mgr->_input = nncc::foundation::make_unique<coco::InputManager>();
+ mgr->_input = nncc::foundation::make_unique<coco::InputManager>(bag_link.get());
mgr->_output = nncc::foundation::make_unique<coco::OutputManager>();
}
m->_entity = std::move(mgr);