summaryrefslogtreecommitdiff
path: root/compiler/moco-tf/src/CanonicalEltwiseInputConnector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/moco-tf/src/CanonicalEltwiseInputConnector.cpp')
-rw-r--r--compiler/moco-tf/src/CanonicalEltwiseInputConnector.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/compiler/moco-tf/src/CanonicalEltwiseInputConnector.cpp b/compiler/moco-tf/src/CanonicalEltwiseInputConnector.cpp
new file mode 100644
index 000000000..adeae39de
--- /dev/null
+++ b/compiler/moco-tf/src/CanonicalEltwiseInputConnector.cpp
@@ -0,0 +1,49 @@
+/*
+ * 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 "CanonicalEltwiseInputConnector.h"
+
+#include <loco/IR/Nodes.h>
+
+namespace moco
+{
+namespace tf
+{
+namespace eltwise
+{
+namespace binary
+{
+
+template <typename NodeTy> void InputConnector<NodeTy>::operator()(const NodePair &p) const
+{
+ _node->lhs(p.first);
+ _node->rhs(p.second);
+}
+
+#define INSTANTIATE(OP) template void InputConnector<loco::OP>::operator()(const NodePair &) const;
+
+INSTANTIATE(EltwiseAdd);
+INSTANTIATE(EltwiseSub);
+INSTANTIATE(EltwiseMax);
+INSTANTIATE(EltwiseMul);
+INSTANTIATE(EltwiseDiv);
+
+#undef INSTANTIATE
+
+} // namespace binary
+} // namespace eltwise
+} // namespace tf
+} // namespace moco