From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 2 Oct 2018 04:34:42 +0000 (+0900) Subject: [coco] Deprecate Layout manipulation via KernelObject (#1714) X-Git-Tag: nncc_backup~1652 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=182f03295f773e78dc9cfb18ac5a28e56931873d;p=platform%2Fcore%2Fml%2Fnnfw.git [coco] Deprecate Layout manipulation via KernelObject (#1714) This commit removes layout manipulation methods from KernelObject. Signed-off-by: Jonghyun Park --- diff --git a/contrib/coco/core/include/coco/IR/KernelObject.h b/contrib/coco/core/include/coco/IR/KernelObject.h index 6dd20c5..bc9d3c0 100644 --- a/contrib/coco/core/include/coco/IR/KernelObject.h +++ b/contrib/coco/core/include/coco/IR/KernelObject.h @@ -49,17 +49,9 @@ public: const nncc::core::ADT::kernel::Shape &shape(void) const; public: - // Deprecated - ElemID &at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col); ElemID at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col) const; public: - // Deprecated - void reorder(const nncc::core::ADT::kernel::Layout &l); - // Deprecated - template void reorder(void) { reorder(LayoutImpl{}); } - -public: const GenericKernelLayout *layout(void) const { return _layout.get(); } void layout(std::unique_ptr &&l) { _layout = std::move(l); } diff --git a/contrib/coco/core/src/IR.test.cpp b/contrib/coco/core/src/IR.test.cpp index 013d397..1c9dd5d 100644 --- a/contrib/coco/core/src/IR.test.cpp +++ b/contrib/coco/core/src/IR.test.cpp @@ -136,10 +136,14 @@ TEST(IR, caffe_conv) const nncc::core::ADT::kernel::Shape ker_shape{1, 1, 3, 3}; auto ker_bag = m->entity()->bag()->create(num_elements(ker_shape)); + auto ker_layout = make_unique(ker_shape); + + ker_layout->reorder(); + auto ker_obj = m->entity()->object()->create(ker_shape); ker_obj->bag(ker_bag); - ker_obj->reorder(); + ker_obj->layout(std::move(ker_layout)); const nncc::core::ADT::feature::Shape ofm_shape{1, 1, 1}; auto ofm_bag = m->entity()->bag()->create(1 * 1 * 1); diff --git a/contrib/coco/core/src/IR/KernelObject.cpp b/contrib/coco/core/src/IR/KernelObject.cpp index d5d4913..6d12ab5 100644 --- a/contrib/coco/core/src/IR/KernelObject.cpp +++ b/contrib/coco/core/src/IR/KernelObject.cpp @@ -36,16 +36,9 @@ KernelObject::~KernelObject() const nncc::core::ADT::kernel::Shape &KernelObject::shape(void) const { return _layout->shape(); } -ElemID &KernelObject::at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col) -{ - return _layout->at(n, ch, row, col); -} - ElemID KernelObject::at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col) const { return _layout->at(n, ch, row, col); } -void KernelObject::reorder(const nncc::core::ADT::kernel::Layout &l) { _layout->reorder(l); } - } // namespace coco diff --git a/contrib/coco/core/src/IR/KernelObject.test.cpp b/contrib/coco/core/src/IR/KernelObject.test.cpp index e578f21..f0dff27 100644 --- a/contrib/coco/core/src/IR/KernelObject.test.cpp +++ b/contrib/coco/core/src/IR/KernelObject.test.cpp @@ -69,6 +69,8 @@ TEST_F(KernelObjectTest, asKernel) ASSERT_EQ(mutable_object->asKernel(), immutable_object->asKernel()); } +// TODO Rewrite this test as a test for GenericKernelLayout +#if 0 TEST_F(KernelObjectTest, at) { const uint32_t N = 1; @@ -110,3 +112,4 @@ TEST_F(KernelObjectTest, at) } } } +#endif