From 0cb21dbfbdbccfd91dac97802699cf68f143532c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 13 Jun 2019 12:49:47 +0900 Subject: [PATCH] [loco_exporter] Initial commit (#3757) This commit creates "loco_exporter" project with minimal implementation. Signed-off-by: Jonghyun Park --- contrib/loco-exporter/.FORMATCHECKED | 0 contrib/loco-exporter/CMakeLists.txt | 5 ++++ contrib/loco-exporter/include/LocoExporter.h | 42 ++++++++++++++++++++++++++++ contrib/loco-exporter/requires.cmake | 1 + contrib/loco-exporter/src/LocoExporter.cpp | 36 ++++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 contrib/loco-exporter/.FORMATCHECKED create mode 100644 contrib/loco-exporter/CMakeLists.txt create mode 100644 contrib/loco-exporter/include/LocoExporter.h create mode 100644 contrib/loco-exporter/requires.cmake create mode 100644 contrib/loco-exporter/src/LocoExporter.cpp diff --git a/contrib/loco-exporter/.FORMATCHECKED b/contrib/loco-exporter/.FORMATCHECKED new file mode 100644 index 0000000..e69de29 diff --git a/contrib/loco-exporter/CMakeLists.txt b/contrib/loco-exporter/CMakeLists.txt new file mode 100644 index 0000000..cd7c03b --- /dev/null +++ b/contrib/loco-exporter/CMakeLists.txt @@ -0,0 +1,5 @@ +file(GLOB_RECURSE SOURCES "src/*.cpp") + +add_library(loco_exporter SHARED ${SOURCES}) +target_include_directories(loco_exporter PUBLIC include) +target_link_libraries(loco_exporter PUBLIC loco) diff --git a/contrib/loco-exporter/include/LocoExporter.h b/contrib/loco-exporter/include/LocoExporter.h new file mode 100644 index 0000000..8e82c36 --- /dev/null +++ b/contrib/loco-exporter/include/LocoExporter.h @@ -0,0 +1,42 @@ +/* + * 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 __LOCO_EXPORTER_H__ +#define __LOCO_EXPORTER_H__ + +#include "loco.h" + +#include + +namespace loco_exporter +{ + +class Exporter +{ +public: + explicit Exporter(loco::Graph *graph); + ~Exporter(); + + /** @brief write to a file + * @param path path to file where to write data + * @throws any file related exceptions + */ + void dumpToFile(const char *path) const; +}; + +} // namespace exporter + +#endif // __LOCO_EXPORTER_H__ diff --git a/contrib/loco-exporter/requires.cmake b/contrib/loco-exporter/requires.cmake new file mode 100644 index 0000000..44f6870 --- /dev/null +++ b/contrib/loco-exporter/requires.cmake @@ -0,0 +1 @@ +require("loco") diff --git a/contrib/loco-exporter/src/LocoExporter.cpp b/contrib/loco-exporter/src/LocoExporter.cpp new file mode 100644 index 0000000..8681719 --- /dev/null +++ b/contrib/loco-exporter/src/LocoExporter.cpp @@ -0,0 +1,36 @@ +/* + * 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 "LocoExporter.h" + +#include + +namespace loco_exporter +{ + +Exporter::Exporter(loco::Graph *graph) +{ + // NOTHING TO DO +} + +Exporter::~Exporter() = default; + +void Exporter::dumpToFile(const char *path) const +{ + throw std::runtime_error{"Not implemented, yet"}; +} + +} // namespace loco_exporter -- 2.7.4