[neurun] Doxygen comments for MemoryPlanner on CPU (#3679)
author김용섭/동작제어Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Fri, 23 Nov 2018 06:01:12 +0000 (15:01 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Fri, 23 Nov 2018 06:01:12 +0000 (15:01 +0900)
* [neurun] Doxygen comments for MemoryPlanner on CPU

Doxygen comments for MemoryPlanner on CPU

Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
* Remove @ingroup

* Fix typo. opernad -> operand

runtimes/neurun/src/backend/cpu/MemoryPlanner.h

index a7e92d1..9891b74 100644 (file)
  * limitations under the License.
  */
 
+/**
+ * @file        MemoryPlanner.h
+ * @brief       This file contains Memory Planning related classes
+ */
+
 #ifndef __NEURUN_BACKEND_CPU_MEMORY_PLANNER_H__
 #define __NEURUN_BACKEND_CPU_MEMORY_PLANNER_H__
 
@@ -29,39 +34,89 @@ namespace backend
 namespace cpu
 {
 
+/**
+ * @brief Structure to have memory offset and size
+ */
 struct Block
 {
   uint32_t offset;
   uint32_t size;
 };
 
+/**
+ * @brief Class to allocate memory
+ */
 class Allocator
 {
 public:
   Allocator(uint32_t capacity);
   ~Allocator();
+  /**
+   * @brief Get memory base pointer
+   * @return base pointer
+   */
   uint8_t *base() const { return _base; }
 
 private:
   uint8_t *_base = nullptr;
 };
 
+/**
+ * @brief Interface to plan memory
+ */
 struct IMemoryPlanner
 {
   using MemoryPlans = std::unordered_map<graph::operand::Index, Block>;
 
+  /**
+   * @brief Claim memory for operand
+   * @param[in] index The operand index
+   * @param[in] size The size of the memory
+   */
   virtual void claim(const graph::operand::Index &, size_t) = 0;
+  /**
+   * @brief Release memory for operand
+   * @param[in] index The operand index
+   */
   virtual void release(const graph::operand::Index &) = 0;
+  /**
+   * @brief Get capacity for memory planning
+   * @return The value of capacity
+   */
   virtual uint32_t capacity() = 0;
+  /**
+   * @brief Get MemoryPlans
+   * @return MemoryPlans
+   */
   virtual MemoryPlans &memory_plans() = 0;
 };
 
+/**
+ * @brief Class to plan memory by bump way
+ */
 class BumpPlanner : public IMemoryPlanner
 {
 public:
+  /**
+   * @brief Claim memory for operand by bump way
+   * @param[in] index The operand index
+   * @param[in] size The size of the memory
+   */
   virtual void claim(const graph::operand::Index &, size_t) override;
+  /**
+   * @brief Release memory for operand by bump way
+   * @param[in] index The operand index
+   */
   virtual void release(const graph::operand::Index &) override;
+  /**
+   * @brief Get capacity for memory planning
+   * @return The value of capacity
+   */
   virtual uint32_t capacity() override { return _capacity; }
+  /**
+   * @brief Get MemoryPlans
+   * @return MemoryPlans
+   */
   virtual MemoryPlans &memory_plans() override { return _mem_plans; }
 
 private:
@@ -69,12 +124,32 @@ private:
   MemoryPlans _mem_plans;
 };
 
+/**
+ * @brief Class to plan memory by firstfit way
+ */
 class FirstFitPlanner : public IMemoryPlanner
 {
 public:
+  /**
+   * @brief Claim memory for operand by firstfit way
+   * @param[in] index The operand index
+   * @param[in] size The size of the memory
+   */
   virtual void claim(const graph::operand::Index &, size_t) override;
+  /**
+   * @brief Release memory for operand by firstfit way
+   * @param[in] index The operand index
+   */
   virtual void release(const graph::operand::Index &) override;
+  /**
+   * @brief Get capacity for memory planning
+   * @return The value of capacity
+   */
   virtual uint32_t capacity() override { return _capacity; }
+  /**
+   * @brief Get MemoryPlans
+   * @return MemoryPlans
+   */
   virtual MemoryPlans &memory_plans() override { return _mem_plans; }
 
 private: