FeatureObject *ObjectManager::create(const nncc::core::ADT::feature::Shape &shape)
{
auto info = make_unique<FeatureObjectInfo>(shape);
- return take(make_unique<FeatureObject>(std::move(info), _link));
+ auto info_ptr = info.get();
+
+ auto feature = make_unique<FeatureObject>(std::move(info), _link);
+ auto feature_ptr = feature.get();
+
+ _obj_link->set(feature_ptr, info_ptr);
+
+ return take(std::move(feature));
}
KernelObject *ObjectManager::create(const nncc::core::ADT::kernel::Shape &shape)
{
auto info = make_unique<KernelObjectInfo>(shape);
- return take(make_unique<KernelObject>(std::move(info), _link));
+ auto info_ptr = info.get();
+
+ auto kernel = make_unique<KernelObject>(std::move(info), _link);
+ auto kernel_ptr = kernel.get();
+
+ _obj_link->set(kernel_ptr, info_ptr);
+
+ return take(std::move(kernel));
}
} // namespace coco
auto o = mgr.create(shape);
ASSERT_EQ(o->shape(), shape);
+ ASSERT_NE(obj_link.find(o), nullptr);
}
TEST(IR_OBJECT_MANAGER, create_kernel)
ASSERT_EQ(o->shape().depth(), shape.depth());
ASSERT_EQ(o->shape().height(), shape.height());
ASSERT_EQ(o->shape().width(), shape.width());
+ ASSERT_NE(obj_link.find(o), nullptr);
}