@@ -275,17 +275,13 @@ sycl::event exec_graph_impl::enqueue(
275275 sycl::detail::createSyclObjFromImpl<sycl::event>(NewEvent);
276276 return QueueEvent;
277277}
278- } // namespace detail
279278
280- template <>
281- command_graph<graph_state::modifiable>::command_graph(
279+ modifiable_command_graph::modifiable_command_graph (
282280 const sycl::context &SyclContext, const sycl::device &SyclDevice,
283281 const sycl::property_list &)
284282 : impl(std::make_shared<detail::graph_impl>(SyclContext, SyclDevice)) {}
285283
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) {
289285 std::vector<std::shared_ptr<detail::node_impl>> DepImpls;
290286 for (auto &D : Deps) {
291287 DepImpls.push_back (sycl::detail::getSyclObjImpl (D));
@@ -295,9 +291,8 @@ node command_graph<graph_state::modifiable>::addImpl(
295291 return sycl::detail::createSyclObjFromImpl<node>(NodeImpl);
296292}
297293
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) {
301296 std::vector<std::shared_ptr<detail::node_impl>> DepImpls;
302297 for (auto &D : Deps) {
303298 DepImpls.push_back (sycl::detail::getSyclObjImpl (D));
@@ -308,8 +303,7 @@ node command_graph<graph_state::modifiable>::addImpl(
308303 return sycl::detail::createSyclObjFromImpl<node>(NodeImpl);
309304}
310305
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) {
313307 std::shared_ptr<detail::node_impl> SenderImpl =
314308 sycl::detail::getSyclObjImpl (Src);
315309 std::shared_ptr<detail::node_impl> ReceiverImpl =
@@ -320,17 +314,13 @@ void command_graph<graph_state::modifiable>::make_edge(node &Src, node &Dest) {
320314 impl->removeRoot (ReceiverImpl); // remove receiver from root node list
321315}
322316
323- template <>
324317command_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 {
327319 return command_graph<graph_state::executable>{this ->impl ,
328320 this ->impl ->getContext ()};
329321}
330322
331- template <>
332- bool command_graph<graph_state::modifiable>::begin_recording(
333- queue &RecordingQueue) {
323+ bool modifiable_command_graph::begin_recording (queue &RecordingQueue) {
334324 auto QueueImpl = sycl::detail::getSyclObjImpl (RecordingQueue);
335325 if (QueueImpl->getCommandGraph () == nullptr ) {
336326 QueueImpl->setCommandGraph (impl);
@@ -347,8 +337,7 @@ bool command_graph<graph_state::modifiable>::begin_recording(
347337 return false ;
348338}
349339
350- template <>
351- bool command_graph<graph_state::modifiable>::begin_recording(
340+ bool modifiable_command_graph::begin_recording (
352341 const std::vector<queue> &RecordingQueues) {
353342 bool QueueStateChanged = false ;
354343 for (queue Queue : RecordingQueues) {
@@ -357,13 +346,9 @@ bool command_graph<graph_state::modifiable>::begin_recording(
357346 return QueueStateChanged;
358347}
359348
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 (); }
363350
364- template <>
365- bool command_graph<graph_state::modifiable>::end_recording(
366- queue &RecordingQueue) {
351+ bool modifiable_command_graph::end_recording (queue &RecordingQueue) {
367352 auto QueueImpl = sycl::detail::getSyclObjImpl (RecordingQueue);
368353 if (QueueImpl->getCommandGraph () == impl) {
369354 QueueImpl->setCommandGraph (nullptr );
@@ -380,8 +365,7 @@ bool command_graph<graph_state::modifiable>::end_recording(
380365 return false ;
381366}
382367
383- template <>
384- bool command_graph<graph_state::modifiable>::end_recording(
368+ bool modifiable_command_graph::end_recording (
385369 const std::vector<queue> &RecordingQueues) {
386370 bool QueueStateChanged = false ;
387371 for (queue Queue : RecordingQueues) {
@@ -390,25 +374,26 @@ bool command_graph<graph_state::modifiable>::end_recording(
390374 return QueueStateChanged;
391375}
392376
393- command_graph<graph_state::executable>::command_graph (
377+ executable_command_graph::executable_command_graph (
394378 const std::shared_ptr<detail::graph_impl> &Graph, const sycl::context &Ctx)
395379 : MTag(rand()),
396380 impl (std::make_shared<detail::exec_graph_impl>(Ctx, Graph)) {
397381 finalizeImpl (); // Create backend representation for executable graph
398382}
399383
400- void command_graph<graph_state::executable> ::finalizeImpl() {
384+ void executable_command_graph ::finalizeImpl () {
401385 // Create PI command-buffers for each device in the finalized context
402386 impl->schedule ();
403387}
404388
405- void command_graph<graph_state::executable> ::update(
389+ void executable_command_graph ::update (
406390 const command_graph<graph_state::modifiable> &Graph) {
407391 (void )Graph;
408392 throw sycl::exception (sycl::make_error_code (errc::invalid),
409393 " Method not yet implemented" );
410394}
411395
396+ } // namespace detail
412397} // namespace experimental
413398} // namespace oneapi
414399} // namespace ext
0 commit comments