// **CAUTION** Child SHOULD inherit DLinkedList<Child, Parent>::Node
template <typename Child, typename Parent> struct DLinkedList
{
- // @brief A hook for Child-Join event
+ /// @brief A hook for Child-Join event
static void joined(Parent *, Child *);
- // @brief A hook for Child-Leave event
+ /// @brief A hook for Child-Leave event
static void leaving(Parent *, Child *);
class Head
bool isOutput(void) const;
public:
- // @brief Return the set of Dep links that point to this bag
+ /// @brief Return the set of Dep links that point to this bag
const DepSet *deps(void) const;
- // @brief Return the set of Read links that point to this bag
+ /// @brief Return the set of Read links that point to this bag
const ReadSet *reads(void) const;
- // @brief Return the set of Update links that point to this bag
+ /// @brief Return the set of Update links that point to this bag
const UpdateSet *updates(void) const;
public:
- // @brief Return a valid pointer if this bag is marked as an input of the model
+ /// @brief Return a valid pointer if this bag is marked as an input of the model
Input *input(void) const { return _input; }
- // @brief Return a valid pointer if this bag is marked as an output of the model
+ /// @brief Return a valid pointer if this bag is marked as an output of the model
Output *output(void) const { return _output; }
public:
- // @brief Replace all the occurence of a bag (except those in Input/Output) with another bag
- //
- // NOTE reaplceWith(b) works correctly only when b is neither Input nor Output
+ /**
+ * @brief Replace all the occurence of a bag (except those in Input/Output) with another bag
+ *
+ * NOTE reaplceWith(b) works correctly only when b is neither Input nor Output
+ */
void replaceWith(Bag *b);
- // @brief Replace all the occurence of a bag in Object with another bag
- //
- // NOTE Unlike replaceWith(b), replaceAllDepsWith(b) has no restriction
+ /**
+ * @brief Replace all the occurence of a bag in Object with another bag
+ *
+ * NOTE Unlike replaceWith(b), replaceAllDepsWith(b) has no restriction
+ */
void replaceAllDepsWith(Bag *);
private:
Output *_output = nullptr;
};
-// @brief Return a set of objects that depends on a given bag
+/// @brief Return a set of objects that depends on a given bag
ObjectSet dependent_objects(const Bag *);
-// @brief Return a set of readers that reads a given bag
+/// @brief Return a set of readers that reads a given bag
Bag::ReaderSet readers(const Bag *);
-// @brief Return a set of updaters that updates a given bag
+/// @brief Return a set of updaters that updates a given bag
Bag::UpdaterSet updaters(const Bag *);
} // namespace coco
Bag *create(uint32_t size);
public:
- // @brief Destroy (= deallocate) a Bag entity
- //
- // NOTE A Bag SHOULD BE detached from IR before destruction
+ /**
+ * @brief Destroy (= deallocate) a Bag entity
+ *
+ * NOTE A Bag SHOULD BE detached from IR before destruction
+ */
void destroy(Bag *b);
};
template <typename Ins> Ins *create(void);
public:
- // @brief Destroy (= deallocate) an Instr instance
- //
- // NOTE destroy(ins) WILL NOT update ins->parent(). An Instruction SHOULD BE detacted from a
- // module before destroy call
+ /**
+ * @brief Destroy (= deallocate) an Instr instance
+ *
+ * NOTE destroy(ins) WILL NOT update ins->parent(). An Instruction SHOULD BE detacted from a
+ * module before destroy call
+ */
void destroy(Instr *);
};
void into(Bag *);
public:
- // @brief Return the number of Element-wise transfers
- //
- // NOTE size() SHOULD BE identical to range().size()
+ /**
+ * @brief Return the number of Element-wise transfers
+ *
+ * NOTE size() SHOULD BE identical to range().size()
+ */
uint32_t size(void) const;
- // @brief Return a set of elements in the destination bag that Shuffle will update
+ /// @brief Return a set of elements in the destination bag that Shuffle will update
std::set<ElemID> range(void) const;
public:
- // @brief Return true if a given elem is updated after execution
+ /// @brief Return true if a given elem is updated after execution
bool defined(const ElemID &dst) const { return _content.find(dst) != _content.end(); }
public:
const UseSet *uses(void) const;
private:
- // @brief Update the link to a producer
- //
- // WARN Only Def class is allowed to access this method
+ /**
+ * @brief Update the link to a producer
+ *
+ * WARN Only Def class is allowed to access this method
+ */
void def(Def *d);
// NOTE "mutable_" prefix is introduced to avoid resolution issue similarly as in Bag
*/
template <typename T> T *safe_cast(Object *);
-// @brief Return the producer of a given object if it exists
+/// @brief Return the producer of a given object if it exists
Object::Producer *producer(const Object *);
-// @brief Return a set of consumers of a given object.
+/// @brief Return a set of consumers of a given object.
Object::ConsumerSet consumers(const Object *);
} // namespace coco
public:
Instr *parent(void) const;
- // @brief Return a pointer to the parent Op
+ /// @brief Return a pointer to the parent Op
Op *up(void) const;
private:
- // @brief A link to Instr from Op
- //
- // WARN Update this field only through Step
+ /**
+ * @brief A link to Instr from Op
+ *
+ * WARN Update this field only through Step
+ */
Step *_step = nullptr;
- // @brief A link to a parent Op
- //
- // WARN Update this field only through Part
- // NOTE An "Op" CANNOT have a link to a parent Op if it is linked to an "Instr"
+ /**
+ * @brief A link to a parent Op
+ *
+ * WARN Update this field only through Part
+ * NOTE An "Op" CANNOT have a link to a parent Op if it is linked to an "Instr"
+ */
Part *_part = nullptr;
};
void arg(Op *arg) { _arg.child(arg); }
private:
- // @brief Link to Op's argument
+ /// @brief Link to Op's argument
Part _arg;
};
void right(Op *op) { _right.child(op); }
private:
- // @brief Left-hand side (LHS) argument
+ /// @brief Left-hand side (LHS) argument
Part _left;
- // @brief Right-hand side (RHS) argument
+ /// @brief Right-hand side (RHS) argument
Part _right;
};
template <typename T> T *create(void);
public:
- // @brief Destroy (= deallocate) a Op instance
- //
- // NOTE destroy(op) WILL NOT update op->parent(). Client SHOULD detach op before destroy(op) call
+ /**
+ * @brief Destroy (= deallocate) a Op instance
+ *
+ * NOTE destroy(op) WILL NOT update op->parent(). Client SHOULD detach op before destroy(op) call
+ */
void destroy(Op *);
- // @brief Destroy a Op tree
- //
- // @require op->parent() == nullptr && op->up() == nullptr
+ /**
+ * @brief Destroy a Op tree
+ *
+ * @require op->parent() == nullptr && op->up() == nullptr
+ */
void destroy_all(Op *);
};
Stride2D _stride;
private:
- // @brief Link to an argument of Conv2D operation (= IFM)
+ /// @brief Link to an argument of Conv2D operation (= IFM)
Part _arg;
};