Rename ncc namespace into mir_onnx in ONNX importer (#6236)
authorПавел Ильютченко/AI Tools Lab /SRR/Engineer/삼성전자 <p.iliutchenk@samsung.com>
Mon, 5 Aug 2019 15:39:48 +0000 (18:39 +0300)
committerEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Mon, 5 Aug 2019 15:39:48 +0000 (18:39 +0300)
* Rename namespace in importer
* Fix onnx_frontend in NNC

Signed-off-by: Pavel Iliutchenko <p.iliutchenk@samsung.com>
compiler/mir-onnx-importer/ONNXImporterImpl.cpp
compiler/mir-onnx-importer/ONNXImporterImpl.h
compiler/mir-onnx-importer/ONNXOpCreator.cpp
compiler/mir-onnx-importer/ONNXOpCreator.h
compiler/mir-onnx-importer/ONNXOpType.h
compiler/mir-onnx-importer/ONNXPerfect.gperf
compiler/mir-onnx-importer/ONNXPerfectHash.h
compiler/nnc/passes/onnx_frontend/ONNXImporterPass.cpp
compiler/nnc/passes/onnx_frontend/ONNXImporterPass.h

index d3d7f0a..41eaea2 100644 (file)
@@ -42,7 +42,7 @@
 #include <stdex/Memory.h>
 #include <utility>
 
-namespace nnc
+namespace mir_onnx
 {
 
 ONNXImporterImpl::ONNXImporterImpl(std::string filename) : _modelFilename(std::move(filename))
@@ -362,4 +362,4 @@ std::unique_ptr<mir::Graph> ONNXImporterImpl::importModel()
   return createIR();
 }
 
-} // namespace nnc
+} // namespace mir_onnx
index f8944a0..6e352dd 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef NNCC_ONNX_IMPORTER_H
-#define NNCC_ONNX_IMPORTER_H
+#ifndef _MIR_ONNX_IMPORTER_H
+#define _MIR_ONNX_IMPORTER_H
 
 #include "ONNXOpCreator.h"
 #include "ONNXOpType.h"
@@ -25,7 +25,7 @@
 #include <memory>
 #include <string>
 
-namespace nnc
+namespace mir_onnx
 {
 
 class ONNXImporterImpl
@@ -54,6 +54,6 @@ private:
   std::unique_ptr<mir::Graph> _graph;
   ONNXOpCreator _opCreator;
 };
-} // namespace nnc
+} // namespace mir_onnx
 
-#endif // NNCC_ONNX_IMPORTER_H
+#endif // _MIR_ONNX_IMPORTER_H
index d1a4005..b4a497e 100644 (file)
@@ -50,7 +50,7 @@
 #include <iostream>
 #include <set>
 
-namespace nnc
+namespace mir_onnx
 {
 
 static mir::TensorVariant fixGroupedKernel(int groups, const mir::TensorVariant &folded_kernel)
@@ -658,4 +658,4 @@ mir::Operation::Output *ONNXOpCreator::convertMIRToONNX(mir::Operation::Output *
   // NHWC -> NCHW
   return createOp<ops::TransposeOp>(arg, std::vector<std::size_t>{0, 3, 1, 2})->getOutput(0);
 }
-} // namespace nnc
+} // namespace mir_onnx
index 8fccf5c..1bee16c 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef NNCC_ONNX_OP_CREATOR_H
-#define NNCC_ONNX_OP_CREATOR_H
+#ifndef _MIR_ONNX_OP_CREATOR_H
+#define _MIR_ONNX_OP_CREATOR_H
 
 #include "onnx/onnx.pb.h"
 #include "ONNXOpType.h"
@@ -31,7 +31,7 @@
 #include <vector>
 #include <memory>
 
-namespace nnc
+namespace mir_onnx
 {
 
 class ONNXOpCreator
@@ -126,5 +126,5 @@ mir::Operation *ONNXOpCreator::createOp(Types &&... args)
   // TODO: set operation names
   return _graph->create<OpType>("", std::forward<Types>(args)...);
 }
-} // namespace nnc
-#endif // NNCC_ONNX_OP_CREATOR_H
+} // namespace mir_onnx
+#endif // _MIR_ONNX_OP_CREATOR_H
index 3466144..a63f9a5 100644 (file)
  * limitations under the License.
  */
 
-#ifndef NNCC_ONNX_OP_TYPES_H
-#define NNCC_ONNX_OP_TYPES_H
+#ifndef _MIR_ONNX_OP_TYPES_H
+#define _MIR_ONNX_OP_TYPES_H
 
-namespace nnc
+namespace mir_onnx
 {
 enum class ONNXOpSupportState
 {
@@ -156,5 +156,5 @@ struct ONNXOpType
   ONNXOpSupportState state;
 }; // ONNXOpType
 
-} // namespace nnc
-#endif // NNCC_ONNX_OP_TYPES_H
+} // namespace mir_onnx
+#endif // _MIR_ONNX_OP_TYPES_H
index 5bbc9c7..9a1ef98 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "ONNXOpType.h"
 
-using namespace nnc;
+using namespace mir_onnx;
 
 %}
 
index b9aa5be..e3ab70d 100644 (file)
@@ -18,7 +18,7 @@
 /* Command-line: gperf --output-file=ONNXPerfectHash.h ONNXPerfect.gperf  */
 /* Computed positions: -k'1-2,$' */
 
-namespace nnc
+namespace mir_onnx
 {
 
 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) && ('%' == 37) && ('&' == 38) &&  \
@@ -425,4 +425,4 @@ const struct ONNXOpType *ONNXPerfectHash::getONNXOpType(const char *str, size_t
   return nullptr;
 } // ONNXPerfectHash::getONNXOpType (const char *str, size_t len)
 
-} // namespace nnc
+} // namespace mir_onnx
index c983b57..deff3d1 100644 (file)
@@ -22,7 +22,7 @@ namespace nnc
 {
 
 ONNXImporterPass::ONNXImporterPass(const std::string &filename)
-    : _pimpl(new ONNXImporterImpl(filename))
+    : _pimpl(new mir_onnx::ONNXImporterImpl(filename))
 {
 }
 
index 087ed57..25b3da5 100644 (file)
 #include <memory>
 #include <string>
 
-namespace nnc
+namespace mir_onnx
 {
+  class ONNXImporterImpl;
+}
 
-class ONNXImporterImpl;
+namespace nnc
+{
 class ONNXImporterPass : public NNImporter
 {
 public:
@@ -38,7 +41,7 @@ public:
   ~ONNXImporterPass() override;
 
 private:
-  std::unique_ptr<ONNXImporterImpl> _pimpl;
+  std::unique_ptr<mir_onnx::ONNXImporterImpl> _pimpl;
   std::unique_ptr<mir::Graph> _graph;
 };