@@ -275,17 +275,13 @@ sycl::event exec_graph_impl::enqueue(
275
275
sycl::detail::createSyclObjFromImpl<sycl::event>(NewEvent);
276
276
return QueueEvent;
277
277
}
278
- } // namespace detail
279
278
280
- template <>
281
- command_graph<graph_state::modifiable>::command_graph(
279
+ modifiable_command_graph::modifiable_command_graph (
282
280
const sycl::context &SyclContext, const sycl::device &SyclDevice,
283
281
const sycl::property_list &)
284
282
: impl(std::make_shared<detail::graph_impl>(SyclContext, SyclDevice)) {}
285
283
286
- template <>
287
- node command_graph<graph_state::modifiable>::addImpl(
288
- const std::vector<node> &Deps) {
284
+ node modifiable_command_graph::addImpl (const std::vector<node> &Deps) {
289
285
std::vector<std::shared_ptr<detail::node_impl>> DepImpls;
290
286
for (auto &D : Deps) {
291
287
DepImpls.push_back (sycl::detail::getSyclObjImpl (D));
@@ -295,9 +291,8 @@ node command_graph<graph_state::modifiable>::addImpl(
295
291
return sycl::detail::createSyclObjFromImpl<node>(NodeImpl);
296
292
}
297
293
298
- template <>
299
- node command_graph<graph_state::modifiable>::addImpl(
300
- std::function<void (handler &)> CGF, const std::vector<node> &Deps) {
294
+ node modifiable_command_graph::addImpl (std::function<void (handler &)> CGF,
295
+ const std::vector<node> &Deps) {
301
296
std::vector<std::shared_ptr<detail::node_impl>> DepImpls;
302
297
for (auto &D : Deps) {
303
298
DepImpls.push_back (sycl::detail::getSyclObjImpl (D));
@@ -308,8 +303,7 @@ node command_graph<graph_state::modifiable>::addImpl(
308
303
return sycl::detail::createSyclObjFromImpl<node>(NodeImpl);
309
304
}
310
305
311
- template <>
312
- void command_graph<graph_state::modifiable>::make_edge(node &Src, node &Dest) {
306
+ void modifiable_command_graph::make_edge (node &Src, node &Dest) {
313
307
std::shared_ptr<detail::node_impl> SenderImpl =
314
308
sycl::detail::getSyclObjImpl (Src);
315
309
std::shared_ptr<detail::node_impl> ReceiverImpl =
@@ -320,17 +314,13 @@ void command_graph<graph_state::modifiable>::make_edge(node &Src, node &Dest) {
320
314
impl->removeRoot (ReceiverImpl); // remove receiver from root node list
321
315
}
322
316
323
- template <>
324
317
command_graph<graph_state::executable>
325
- command_graph<graph_state::modifiable>::finalize(
326
- const sycl::property_list &) const {
318
+ modifiable_command_graph::finalize (const sycl::property_list &) const {
327
319
return command_graph<graph_state::executable>{this ->impl ,
328
320
this ->impl ->getContext ()};
329
321
}
330
322
331
- template <>
332
- bool command_graph<graph_state::modifiable>::begin_recording(
333
- queue &RecordingQueue) {
323
+ bool modifiable_command_graph::begin_recording (queue &RecordingQueue) {
334
324
auto QueueImpl = sycl::detail::getSyclObjImpl (RecordingQueue);
335
325
if (QueueImpl->getCommandGraph () == nullptr ) {
336
326
QueueImpl->setCommandGraph (impl);
@@ -347,8 +337,7 @@ bool command_graph<graph_state::modifiable>::begin_recording(
347
337
return false ;
348
338
}
349
339
350
- template <>
351
- bool command_graph<graph_state::modifiable>::begin_recording(
340
+ bool modifiable_command_graph::begin_recording (
352
341
const std::vector<queue> &RecordingQueues) {
353
342
bool QueueStateChanged = false ;
354
343
for (queue Queue : RecordingQueues) {
@@ -357,13 +346,9 @@ bool command_graph<graph_state::modifiable>::begin_recording(
357
346
return QueueStateChanged;
358
347
}
359
348
360
- template <> bool command_graph<graph_state::modifiable>::end_recording() {
361
- return impl->clearQueues ();
362
- }
349
+ bool modifiable_command_graph::end_recording () { return impl->clearQueues (); }
363
350
364
- template <>
365
- bool command_graph<graph_state::modifiable>::end_recording(
366
- queue &RecordingQueue) {
351
+ bool modifiable_command_graph::end_recording (queue &RecordingQueue) {
367
352
auto QueueImpl = sycl::detail::getSyclObjImpl (RecordingQueue);
368
353
if (QueueImpl->getCommandGraph () == impl) {
369
354
QueueImpl->setCommandGraph (nullptr );
@@ -380,8 +365,7 @@ bool command_graph<graph_state::modifiable>::end_recording(
380
365
return false ;
381
366
}
382
367
383
- template <>
384
- bool command_graph<graph_state::modifiable>::end_recording(
368
+ bool modifiable_command_graph::end_recording (
385
369
const std::vector<queue> &RecordingQueues) {
386
370
bool QueueStateChanged = false ;
387
371
for (queue Queue : RecordingQueues) {
@@ -390,25 +374,26 @@ bool command_graph<graph_state::modifiable>::end_recording(
390
374
return QueueStateChanged;
391
375
}
392
376
393
- command_graph<graph_state::executable>::command_graph (
377
+ executable_command_graph::executable_command_graph (
394
378
const std::shared_ptr<detail::graph_impl> &Graph, const sycl::context &Ctx)
395
379
: MTag(rand()),
396
380
impl (std::make_shared<detail::exec_graph_impl>(Ctx, Graph)) {
397
381
finalizeImpl (); // Create backend representation for executable graph
398
382
}
399
383
400
- void command_graph<graph_state::executable> ::finalizeImpl() {
384
+ void executable_command_graph ::finalizeImpl () {
401
385
// Create PI command-buffers for each device in the finalized context
402
386
impl->schedule ();
403
387
}
404
388
405
- void command_graph<graph_state::executable> ::update(
389
+ void executable_command_graph ::update (
406
390
const command_graph<graph_state::modifiable> &Graph) {
407
391
(void )Graph;
408
392
throw sycl::exception (sycl::make_error_code (errc::invalid),
409
393
" Method not yet implemented" );
410
394
}
411
395
396
+ } // namespace detail
412
397
} // namespace experimental
413
398
} // namespace oneapi
414
399
} // namespace ext
0 commit comments