#include "loco/IR/DataType.h"
#include "loco/IR/Nodes.h"
#include "loco/IR/NodePool.h"
+#include "loco/IR/GraphInputIndex.h"
+#include "loco/IR/GraphOutputIndex.h"
#include "loco/ADT/ObjectPool.h"
~GraphInput() = default;
+public:
+ GraphInputIndex index(void) const { return _index; }
+
private:
uint32_t _index;
~GraphOutput() = default;
+public:
+ GraphOutputIndex index(void) const { return _index; }
+
private:
uint32_t _index;
--- /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 __LOCO_IR_GRAPH_INPUT_INDEX_H__
+#define __LOCO_IR_GRAPH_INPUT_INDEX_H__
+
+#include <cstdint>
+
+namespace loco
+{
+
+using GraphInputIndex = uint32_t;
+
+} // namespace loco
+
+#endif // __LOCO_IR_GRAPH_INPUT_INDEX_H__
--- /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 __LOCO_IR_GRAPH_OUTPUT_INDEX_H__
+#define __LOCO_IR_GRAPH_OUTPUT_INDEX_H__
+
+#include <cstdint>
+
+namespace loco
+{
+
+using GraphOutputIndex = uint32_t;
+
+} // namespace loco
+
+#endif // __LOCO_IR_GRAPH_OUTPUT_INDEX_H__
#include "loco/IR/DepthwiseFilterCodec.h"
#include "loco/IR/NodeMixins.h"
#include "loco/IR/CanonicalNodeDecl.h"
+#include "loco/IR/GraphInputIndex.h"
+#include "loco/IR/GraphOutputIndex.h"
namespace loco
{
class GraphInput;
class GraphOutput;
-// TODO Find a proper location for these declarations
-using GraphInputIndex = uint32_t;
-using GraphOutputIndex = uint32_t;
-
/**
* @brief Make a value visible to user
*/
// TODO Add more checks
ASSERT_EQ(input->shape(), nullptr);
+ ASSERT_EQ(input->index(), 0);
}
TEST(GraphTest, create_output)
// TODO Add more checks
ASSERT_EQ(output->shape(), nullptr);
+ ASSERT_EQ(output->index(), 0);
}
namespace
--- /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 "loco/IR/GraphInputIndex.h"
+
+// NOTE This file validates "GraphInputIndex.h". Please DO NOT remove this file.
--- /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 "loco/IR/GraphOutputIndex.h"
+
+// NOTE This file validates "GraphOutputIndex.h". Please DO NOT remove this file.