diff options
Diffstat (limited to 'runtime/neurun/core/include/ir/operand/ParentInfo.h')
-rw-r--r-- | runtime/neurun/core/include/ir/operand/ParentInfo.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/runtime/neurun/core/include/ir/operand/ParentInfo.h b/runtime/neurun/core/include/ir/operand/ParentInfo.h new file mode 100644 index 000000000..92dac2b63 --- /dev/null +++ b/runtime/neurun/core/include/ir/operand/ParentInfo.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018 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. + */ + +/** + * @file ParentInfo.h + * @brief This file contains ParentInfo class and internal Coordinate4D class + * to represent subsumption between operand + */ + +#ifndef __NEURUN_IR_OPERAND_PARENT_INFO_H__ +#define __NEURUN_IR_OPERAND_PARENT_INFO_H__ + +#include <stdint.h> + +#include "ir/Index.h" +#include "util/Coordinates.h" + +namespace neurun +{ +namespace ir +{ +namespace operand +{ + +/** + * @brief Class to represent parent operand in child operand + */ +class ParentInfo +{ +public: + /** + * @brief Construct a new ParentInfo object + * @param[in] parent Index of parent operand + * @param[in] coordinate Offset of child operand in parent operand + * @return + */ + ParentInfo(const OperandIndex parent, const util::Coordinates &coordinate) + : _parent{parent}, _coordinate{coordinate} + { + // DO NOTHING + } + +public: + /** + * @brief Return parent index + * @return Parent index + */ + OperandIndex parent(void) const { return _parent; } + /** + * @brief Retern offset in parent + * @return Offset + */ + util::Coordinates offset(void) const { return _coordinate; } + +private: + OperandIndex _parent; + util::Coordinates _coordinate; +}; + +} // namespace operand +} // namespace ir +} // namespace neurun + +#endif // __NEURUN_IR_OPERAND_PARENT_INFO_H__ |