@@ -22,9 +22,36 @@ limitations under the License.
2222
2323#include " directed_graph_edge_desc_concept.hpp"
2424
25+ /* *
26+ * @file computational_dag_concept.hpp
27+ * @brief Concepts for Computational Directed Acyclic Graphs (cDAGs).
28+ *
29+ * This file defines concepts that validate whether a graph type satisfies the requirements
30+ * of a computational DAG.
31+ *
32+ * A Computational DAG combines:
33+ * - The `directed_graph_concept`.
34+ * - Mandatory vertex weights: work, communication, and memory.
35+ *
36+ * Optional extensions include:
37+ * - Vertex types (for heterogeneous systems).
38+ * - Edge weights (communication).
39+ *
40+ * A computational DAG serves as an input to scheduling algorithms.
41+ */
42+
2543namespace osp {
2644
27- // weighted vertices
45+ /* *
46+ * @brief Concept to check if a graph has vertex weights.
47+ *
48+ * Requires validation of:
49+ * - `vertex_work_weight(v)`: Returns arithmetic type.
50+ * - `vertex_comm_weight(v)`: Returns arithmetic type.
51+ * - `vertex_mem_weight(v)`: Returns arithmetic type.
52+ *
53+ * @tparam T The graph type.
54+ */
2855template <typename T, typename = void >
2956struct has_vertex_weights : std::false_type {};
3057
@@ -41,7 +68,18 @@ struct has_vertex_weights<T,
4168template <typename T>
4269inline constexpr bool has_vertex_weights_v = has_vertex_weights<T>::value;
4370
44- // typed vertices concept
71+ /* *
72+ * @brief Concept to check if a graph has typed vertices.
73+ *
74+ * Requires validation of:
75+ * - `vertex_type(v)`: Returns an integral type representing the type of vertex `v`.
76+ * - `num_vertex_types()`: Returns the total number of distinct vertex types.
77+ *
78+ * This is useful for scheduling on heterogeneous resources where tasks (vertices)
79+ * may be compatible only with certain processor types.
80+ *
81+ * @tparam T The graph type.
82+ */
4583template <typename T, typename = void >
4684struct has_typed_vertices : std::false_type {};
4785
@@ -54,7 +92,15 @@ struct has_typed_vertices<T, std::void_t<decltype(std::declval<T>().vertex_type(
5492template <typename T>
5593inline constexpr bool has_typed_vertices_v = has_typed_vertices<T>::value;
5694
57- // weighted edges concept
95+ /* *
96+ * @brief Concept to check if edges have communication weights.
97+ *
98+ * Requires:
99+ * - The graph must satisfy `is_directed_graph_edge_desc` (supports edge descriptors).
100+ * - `edge_comm_weight(e)`: Returns an arithmetic type for a given edge descriptor `e`.
101+ *
102+ * @tparam T The graph type.
103+ */
58104template <typename T, typename = void >
59105struct has_edge_weights : std::false_type {};
60106
@@ -69,7 +115,15 @@ struct has_edge_weights<T,
69115template <typename T>
70116inline constexpr bool has_edge_weights_v = has_edge_weights<T>::value;
71117
72- // computational dag concept without explicit edges
118+ /* *
119+ * @brief Concept for a basic computational DAG.
120+ *
121+ * A computational DAG must:
122+ * - Be a directed graph (`is_directed_graph`).
123+ * - Have mandatory vertex weights (`has_vertex_weights`): work, communication, and memory.
124+ *
125+ * @tparam T The graph type.
126+ */
73127template <typename T, typename = void >
74128struct is_computational_dag : std::false_type {};
75129
@@ -79,8 +133,13 @@ struct is_computational_dag<T, std::void_t<>> : std::conjunction<is_directed_gra
79133template <typename T>
80134inline constexpr bool is_computational_dag_v = is_computational_dag<T>::value;
81135
82-
83- // computational dag with typed vertices concept
136+ /* *
137+ * @brief Concept for a computational DAG with typed vertices.
138+ *
139+ * Extends `is_computational_dag` by also requiring `has_typed_vertices`.
140+ *
141+ * @tparam T The graph type.
142+ */
84143template <typename T, typename = void >
85144struct is_computational_dag_typed_vertices : std::false_type {};
86145
@@ -91,9 +150,14 @@ struct is_computational_dag_typed_vertices<T, std::void_t<>>
91150template <typename T>
92151inline constexpr bool is_computational_dag_typed_vertices_v = is_computational_dag_typed_vertices<T>::value;
93152
94-
95-
96- // computational dag with explicit edges concept
153+ /* *
154+ * @brief Concept for a computational DAG that supports explicit edge descriptors.
155+ *
156+ * Extends `is_computational_dag` by requiring `is_directed_graph_edge_desc`,
157+ * allowing iteration over edges using explicit descriptors.
158+ *
159+ * @tparam T The graph type.
160+ */
97161template <typename T, typename = void >
98162struct is_computational_dag_edge_desc : std::false_type {};
99163
@@ -104,7 +168,13 @@ struct is_computational_dag_edge_desc<T, std::void_t<>>
104168template <typename T>
105169inline constexpr bool is_computational_dag_edge_desc_v = is_computational_dag_edge_desc<T>::value;
106170
107- // computational_dag_typed_vertices_edge_idx concept
171+ /* *
172+ * @brief Concept for a computational DAG with both typed vertices and edge descriptors.
173+ *
174+ * Combines `is_directed_graph_edge_desc` and `is_computational_dag_typed_vertices`.
175+ *
176+ * @tparam T The graph type.
177+ */
108178template <typename T, typename = void >
109179struct is_computational_dag_typed_vertices_edge_desc : std::false_type {};
110180
0 commit comments