#define __COCO_IR_FEATURE_OBJECT_H__
#include "coco/IR/Object.h"
-#include "coco/IR/FeatureObjectInfo.h"
#include "coco/IR/FeatureLayout.h"
#include "coco/IR/GenericFeatureLayout.h"
#include "coco/IR/ElemID.h"
{
public:
FeatureObject() = default;
- explicit FeatureObject(std::unique_ptr<FeatureObjectInfo> &&info);
+ explicit FeatureObject(const nncc::core::ADT::feature::Shape &shape);
public:
~FeatureObject();
void layout(std::unique_ptr<FeatureLayout> &&l) { _layout = std::move(l); }
private:
- std::unique_ptr<FeatureObjectInfo> _info;
std::unique_ptr<FeatureLayout> _layout;
};
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __COCO_IR_FEATURE_OBJECT_INFO_FORWARD_H__
-#define __COCO_IR_FEATURE_OBJECT_INFO_FORWARD_H__
-
-namespace coco
-{
-
-class FeatureObjectInfo;
-
-} // namespace coco
-
-#endif // __COCO_IR_FEATURE_OBJECT_INFO_FORWARD_H__
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __COCO_IR_FEATURE_OBJECT_INFO_H__
-#define __COCO_IR_FEATURE_OBJECT_INFO_H__
-
-#include <nncc/core/ADT/feature/Shape.h>
-
-namespace coco
-{
-
-class FeatureObjectInfo final
-{
-public:
- FeatureObjectInfo(const nncc::core::ADT::feature::Shape &shape) : _shape{shape}
- {
- // DO NOTHING
- }
-
-public:
- const nncc::core::ADT::feature::Shape &shape(void) const { return _shape; }
-
-private:
- nncc::core::ADT::feature::Shape const _shape;
-};
-
-} // namespace coco
-
-#endif // __COCO_IR_FEATURE_OBJECT_INFO_H__
*/
#include "coco/IR/FeatureObject.h"
-#include "coco/IR/FeatureObjectInfo.h"
#include <nncc/core/ADT/feature/CHWLayout.h>
#include <nncc/foundation/Memory.h>
namespace coco
{
-FeatureObject::FeatureObject(std::unique_ptr<FeatureObjectInfo> &&info) : _info(std::move(info))
+FeatureObject::FeatureObject(const nncc::core::ADT::feature::Shape &shape)
{
- _layout = make_unique<GenericFeatureLayout>(_info->shape());
+ _layout = make_unique<GenericFeatureLayout>(shape);
}
FeatureObject::~FeatureObject()
// DO NOTHING
}
-const nncc::core::ADT::feature::Shape &FeatureObject::shape(void) const { return _info->shape(); }
+const nncc::core::ADT::feature::Shape &FeatureObject::shape(void) const { return _layout->shape(); }
ElemID FeatureObject::at(uint32_t ch, uint32_t row, uint32_t col) const
{
*/
#include "coco/IR/FeatureObject.h"
-#include "coco/IR/FeatureObjectInfo.h"
#include <nncc/foundation/Memory.h>
protected:
coco::FeatureObject *allocate(const feature::Shape &shape)
{
- auto info = make_unique<coco::FeatureObjectInfo>(shape);
- auto o = new coco::FeatureObject{std::move(info)};
+ auto o = new coco::FeatureObject{shape};
_allocated.emplace_back(o);
return o;
}
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "coco/IR/FeatureObjectInfo.h"
-
-#include <gtest/gtest.h>
-
-TEST(FeatureObjectInfoTest, constructor)
-{
- const nncc::core::ADT::feature::Shape shape{1, 3, 3};
- const coco::FeatureObjectInfo info{shape};
-
- ASSERT_EQ(info.shape(), shape);
-}
#include "coco/IR/ObjectManager.h"
#include "coco/IR/FeatureObject.h"
-#include "coco/IR/FeatureObjectInfo.h"
#include "coco/IR/KernelObject.h"
#include <nncc/foundation/Memory.h>
FeatureObject *ObjectManager::create(const nncc::core::ADT::feature::Shape &shape)
{
- auto info = make_unique<FeatureObjectInfo>(shape);
- auto info_ptr = info.get();
-
- auto feature = make_unique<FeatureObject>(std::move(info));
+ auto feature = make_unique<FeatureObject>(shape);
auto feature_ptr = feature.get();
modulize(feature_ptr);