[enco] Remove deprecated intermediates function (#2618)
author남궁석/동작제어Lab(SR)/Engineer/삼성전자 <sk.namkoong@samsung.com>
Tue, 11 Dec 2018 09:37:33 +0000 (18:37 +0900)
committer박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 11 Dec 2018 09:37:33 +0000 (18:37 +0900)
This commit will remove deprecated function, `intermediates`

Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
contrib/enco/core/src/CppCode.cpp

index 8822b2c..7fd1485 100644 (file)
@@ -137,69 +137,6 @@ std::set<coco::Bag *> hosted(const enco::Code *code)
 
   return res;
 }
-
-// WARN Deprecated
-/** @brief Return a set of Bag to be allocated */
-// NOTE An input/output bag may be included in the retrun set of "intermediates"
-std::set<coco::Bag *> intermediates(const enco::Code *code)
-{
-  // NOTE The current implementation may allocate unnecessary buffers (such as weight)
-  // TODO Optimize this!
-  std::set<coco::Bag *> res;
-
-  auto accessed_by_host = [code](const coco::Bag *b) {
-    auto block_of = [](coco::Locatable *loc) -> coco::Block * {
-      if (auto ins = loc->loc())
-      {
-        if (auto blk = ins->parent())
-        {
-          return blk;
-        }
-      }
-
-      return nullptr;
-    };
-
-    auto is_host_block = [code](const coco::Block *blk) {
-      auto m = blk->module();
-      auto ann_ctx = enco::SubnetManager::context(m);
-      return (blk) ? (ann_ctx->find(blk) == nullptr) : false;
-    };
-
-    for (const auto &updater : coco::updaters(b))
-    {
-      if (is_host_block(block_of(updater)))
-      {
-        return true;
-      }
-    }
-
-    for (const auto &reader : coco::readers(b))
-    {
-      if (is_host_block(block_of(reader)))
-      {
-        return true;
-      }
-    }
-
-    return false;
-  };
-
-  for (uint32_t n = 0; n < code->module()->entity()->bag()->size(); ++n)
-  {
-    auto bag = code->module()->entity()->bag()->at(n);
-
-    // TODO Remove unnecessary indentation
-    {
-      if (accessed_by_host(bag))
-      {
-        res.insert(bag);
-      }
-    }
-  }
-
-  return res;
-}
 } // namespace
 
 namespace enco