From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Thu, 6 Sep 2018 00:52:58 +0000 (+0900) Subject: [coco] Introduce insert method in Shuffle (#1363) X-Git-Tag: nncc_backup~1924 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1883bc7cdbaa259e8c4a79358fead28337b5fc5;p=platform%2Fcore%2Fml%2Fnnfw.git [coco] Introduce insert method in Shuffle (#1363) * [coco] Introduce insert method in Shuffle This commit introduces insert method in Shuffle instruction as the first step toward partial shuffling support. Signed-off-by: Jonghyun Park * Update _content properly inside insert --- diff --git a/contrib/coco/core/include/coco/IR/Shuffle.h b/contrib/coco/core/include/coco/IR/Shuffle.h index 43baf01..1973d27 100644 --- a/contrib/coco/core/include/coco/IR/Shuffle.h +++ b/contrib/coco/core/include/coco/IR/Shuffle.h @@ -47,8 +47,12 @@ public: public: const ElemID &at(uint32_t n) const { return _content.at(n); } + // NOTE This method is deprecated. Pleaes do NOT use this anymore ElemID &at(uint32_t n) { return _content.at(n); } +public: + void insert(const ElemID &from, const ElemID &into); + private: const PtrLink *const _instr_link; diff --git a/contrib/coco/core/src/IR/Shuffle.cpp b/contrib/coco/core/src/IR/Shuffle.cpp index 54d075b..08926cb 100644 --- a/contrib/coco/core/src/IR/Shuffle.cpp +++ b/contrib/coco/core/src/IR/Shuffle.cpp @@ -15,6 +15,8 @@ std::set &operator+=(std::set &res, coco::Bag *b) namespace coco { +void Shuffle::insert(const ElemID &from, const ElemID &into) { _content.at(into.value()) = from; } + std::set Shuffle::reads(void) const { std::set res;