Skip to content

Commit 1eb97e2

Browse files
authored
using constructor for command graph creation (II/II)
1 parent b5779bb commit 1eb97e2

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,19 @@ namespace sycl::ext::oneapi::experimental {
114114
executable
115115
};
116116
117-
template<graph_state State>
118-
class graph {
117+
template<graph_state State=graph_state::modifiable>
118+
class command_graph {
119119
public:
120-
operator graph<graph_state::executable>();
120+
operator command_graph<graph_state::executable>();
121121
};
122122
123-
graph<graph_state::modifiable> make_graph();
123+
template<>
124+
class command_graph<graph_state::executable>{
125+
public:
126+
command_graph() = delete;
127+
};
124128
125-
graph<graph_state::executable> compile(const graph<graph_state::modifiable> Graph);
129+
command_graph<graph_state::executable> compile(const command_graph<graph_state::modifiable> Graph);
126130
127131
}
128132
@@ -135,21 +139,21 @@ The following member functions are added to the queue class.
135139
136140
namespace sycl {
137141
138-
event submit(const ext::oneapi::experimental::graph<ext::oneapi::experimental::graph_state::executable>& my_graph);
142+
event submit(const ext::oneapi::experimental::command_graph<ext::oneapi::experimental::graph_state::executable>& my_graph);
139143
140144
} // namespace sycl
141145
142146
----
143147

144148
=== Executable Graph
145149

146-
A `graph` object in `graph_state::executable` represents a user generated device and context specific execution object that is submitted to a queue for execution.
147-
The structure of such a `graph` object in this state is immutable and cannot be changed, so are the tasks assigned with each node.
150+
A `command_graph` object in `graph_state::executable` represents a user generated device and context specific execution object that is submitted to a queue for execution.
151+
The structure of such a `command_graph` object in this state is immutable and cannot be changed, so are the tasks assigned with each node.
148152
Support of submitting a graph for execution, before a previous execution has been completed is backend specific. The runtime may throw an error.
149153

150154
=== Graph member and helper functions
151155

152-
Table 3. Constructor of the `graph` class.
156+
Table 3. Constructor of the `command_graph` class.
153157
[cols="2a,a"]
154158
|===
155159
|Constructor|Description
@@ -158,13 +162,13 @@ Table 3. Constructor of the `graph` class.
158162
[source,c++]
159163
----
160164
/* available only when graph_state == modifiable */`
161-
graph();
165+
command_graph();
162166
----
163-
|Creates a `graph` object.
167+
|Creates a `command_graph` object.
164168

165169
|===
166170

167-
Table 4. Member functions of the `graph` class.
171+
Table 4. Member functions of the `command_graph` class.
168172
[cols="2a,a"]
169173
|===
170174
|Member function|Description
@@ -188,7 +192,7 @@ template<typename T>
188192

189193
Memory that is allocated by the following functions is owned by the specific graph. When freed inside the graph, the memory is only accessible before the `free` node is executed and after the `malloc` node is executed.
190194

191-
Table 5. Member functions of the `graph` class (memory operations).
195+
Table 5. Member functions of the `command_graph` class (memory operations).
192196
[cols="2a,a"]
193197
|===
194198
|Member function|Description
@@ -260,7 +264,7 @@ node free(void *data, const std::vector<node>& dep = {});
260264

261265
|===
262266

263-
Table 6. Member functions of the `graph` class (convenience shortcuts).
267+
Table 6. Member functions of the `command_graph` class (convenience shortcuts).
264268
[cols="2a,a"]
265269
|===
266270
|Member function|Description
@@ -289,20 +293,20 @@ node parallel_for(nd_range<Dims> executionRange, Rest&& rest, const std::vector<
289293
----
290294
|Adding a node that encapsulates a `parallel_for` operation.
291295

292-
|===
293-
294-
Table 7. Helper functions of the `graph` class.
295-
[cols="a,a"]
296-
|===
297-
|Function name|Description
298-
299-
|
300-
[source,c++]
301-
----
302-
graph<graph_state::modifiable> make_graph();
303-
----
304-
|Creates a `graph` object in the `graph_state::modifiable` state.
305-
296+
// |===
297+
//
298+
// Table 7. Helper functions of the `graph` class.
299+
// [cols="a,a"]
300+
// |===
301+
// |Function name|Description
302+
//
303+
// |
304+
// [source,c++]
305+
// ----
306+
// graph<graph_state::modifiable> make_graph();
307+
// ----
308+
// |Creates a `graph` object in the `graph_state::modifiable` state.
309+
306310
|===
307311

308312
=== Node member functions
@@ -329,7 +333,7 @@ Table 9. Member functions of the `node` class.
329333
|
330334
[source,c++]
331335
----
332-
void set_graph(graph<graph_state::modifiable>& Graph);
336+
void set_graph(command_graph<graph_state::modifiable>& Graph);
333337
----
334338
|Assigns a `node` object to a `graph`.
335339

0 commit comments

Comments
 (0)