Extract `backend::Backend` as a separate file.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
--- /dev/null
+/*
+ * Copyright (c) 2019 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 "Backend.h"
+
+#include "backend/interface/IConfig.h"
+#include "backend/interface/ITensorBuilder.h"
+#include "backend/interface/IStageGenerator.h"
+
+namespace neurun
+{
+namespace backend
+{
+
+Backend::Backend(const std::shared_ptr<neurun::backend::IConfig> &backend_config,
+ const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen)
+ : _config(backend_config), _stage_gen(stage_gen)
+{
+ backend_config->initialize();
+}
+
+const std::shared_ptr<neurun::backend::IConfig> Backend::config() const { return _config; }
+
+const std::shared_ptr<neurun::backend::IStageGenerator> Backend::stage_gen() const
+{
+ return _stage_gen;
+}
+
+const std::shared_ptr<neurun::backend::ITensorBuilder> Backend::tensor_builder() const
+{
+ return _stage_gen->tensor_builder();
+}
+
+} // namespace backend
+} // namespace neurun
--- /dev/null
+/*
+ * Copyright (c) 2019 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 __NEURUN_BACKEND_BACKEND_H__
+#define __NEURUN_BACKEND_BACKEND_H__
+
+#include <memory>
+
+namespace neurun
+{
+namespace backend
+{
+
+struct IConfig;
+struct IStageGenerator;
+struct ITensorBuilder;
+
+class Backend
+{
+public:
+ Backend(const std::shared_ptr<neurun::backend::IConfig> &backend_config,
+ const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen);
+
+ Backend(void) : _config(nullptr), _stage_gen(nullptr)
+ {
+ // DO NOTHING
+ }
+
+public:
+ const std::shared_ptr<neurun::backend::IConfig> config() const;
+ const std::shared_ptr<neurun::backend::IStageGenerator> stage_gen() const;
+ const std::shared_ptr<neurun::backend::ITensorBuilder> tensor_builder() const;
+
+private:
+ std::shared_ptr<neurun::backend::IConfig> _config;
+ std::shared_ptr<neurun::backend::IStageGenerator> _stage_gen;
+};
+
+} // namespace backend
+} // namespace neurun
+
+#endif // __NEURUN_BACKEND_BACKEND_H__
namespace backend
{
-Backend::Backend(const std::shared_ptr<neurun::backend::IConfig> &backend_config,
- const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen)
- : _config(backend_config), _stage_gen(stage_gen)
-{
- backend_config->initialize();
-}
-
-const std::shared_ptr<neurun::backend::IConfig> Backend::config() const { return _config; }
-
-const std::shared_ptr<neurun::backend::IStageGenerator> Backend::stage_gen() const
-{
- return _stage_gen;
-}
-
-const std::shared_ptr<neurun::backend::ITensorBuilder> Backend::tensor_builder() const
-{
- return _stage_gen->tensor_builder();
-}
-
template <typename T, class... Types>
void BackendManager::loadObjectFromPlugin(std::shared_ptr<T> &object_of_plugin_class,
const std::string obj_creator_func_name, void *handle,
#include <map>
#include "model/operand/Set.h"
+#include "Backend.h"
namespace neurun
{
namespace backend
{
-struct IConfig;
-struct IStageGenerator;
-struct ITensorBuilder;
-
-class Backend
-{
-public:
- Backend(const std::shared_ptr<neurun::backend::IConfig> &backend_config,
- const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen);
-
- Backend(void) : _config(nullptr), _stage_gen(nullptr)
- {
- // DO NOTHING
- }
-
-public:
- const std::shared_ptr<neurun::backend::IConfig> config() const;
- const std::shared_ptr<neurun::backend::IStageGenerator> stage_gen() const;
- const std::shared_ptr<neurun::backend::ITensorBuilder> tensor_builder() const;
-
-private:
- std::shared_ptr<neurun::backend::IConfig> _config;
- std::shared_ptr<neurun::backend::IStageGenerator> _stage_gen;
-};
-
class BackendManager
{
public: