@@ -458,15 +458,19 @@ dynParamAccessor.update(bufferB.get_access());
458458Example showing how a graph with a dynamic command group node can be updated.
459459
460460``` cpp
461+ ...
462+ using namespace sycl ;
463+ namespace sycl_ext = sycl::ext::oneapi::experimental;
464+
461465queue Queue{};
462- exp_ext ::command_graph Graph{Queue.get_context(), Queue.get_device()};
466+ sycl_ext ::command_graph Graph{Queue.get_context(), Queue.get_device()};
463467
464468int * PtrA = malloc_device<int >(1024, Queue);
465- int * PtrB = malloc_device<int >(1024, Queue) ;
469+ int * PtrB = malloc_device<int >(1024, Queue);
466470
467471auto CgfA = [ &] (handler &cgh) {
468472 cgh.parallel_for(1024, [ =] (item<1> Item) {
469- PtrA[ Item.get_id()] = 1;
473+ PtrA[ Item.get_id()] = 1;
470474 });
471475};
472476
@@ -477,18 +481,18 @@ auto CgfB = [&](handler &cgh) {
477481};
478482
479483// Construct a dynamic command-group with CgfA as the active cgf (index 0).
480- auto DynamicCG = exp_ext ::dynamic_command_group(Graph, {CgfA, CgfB});
484+ auto DynamicCG = sycl_ext ::dynamic_command_group(Graph, {CgfA, CgfB});
481485
482486// Create a dynamic command-group graph node.
483487auto DynamicCGNode = Graph.add(DynamicCG);
484488
485- auto ExecGraph = Graph.finalize(exp_ext ::property::graph::updatable{});
489+ auto ExecGraph = Graph.finalize(sycl_ext ::property::graph::updatable{});
486490
487491// The graph will execute CgfA.
488492Queue.ext_oneapi_graph(ExecGraph).wait();
489493
490494// Sets CgfB as active in the dynamic command-group (index 1).
491- DynamicCG.set_active_cgf (1);
495+ DynamicCG.set_active_index (1);
492496
493497// Calls update to update the executable graph node with the changes to DynamicCG.
494498ExecGraph.update(DynamicCGNode);
@@ -503,45 +507,49 @@ Example showing how a graph with a dynamic command group that uses dynamic
503507parameters in a node can be updated.
504508
505509```cpp
506- size_t n = 1024;
510+ ...
511+ using namespace sycl;
512+ namespace sycl_ext = sycl::ext::oneapi::experimental;
513+
514+ size_t N = 1024;
507515queue Queue{};
508- auto myContext = Queue.get_context();
509- auto myDevice = Queue.get_device();
510- exp_ext ::command_graph Graph{myContext, myDevice };
516+ auto MyContext = Queue.get_context();
517+ auto MyDevice = Queue.get_device();
518+ sycl_ext ::command_graph Graph{MyContext, MyDevice };
511519
512- int *PtrA = malloc_device<int>(n , Queue);
513- int *PtrB = malloc_device<int>(n , Queue) ;
520+ int *PtrA = malloc_device<int>(N , Queue);
521+ int *PtrB = malloc_device<int>(N , Queue);
514522
515523// Kernels loaded from kernel bundle
516- const std::vector<kernel_id> builtinKernelIds =
517- myDevice .get_info<info::device::built_in_kernel_ids>();
518- kernel_bundle<bundle_state::executable> myBundle =
519- get_kernel_bundle<sycl::bundle_state::executable>(myContext , { myDevice }, builtinKernelIds );
524+ const std::vector<kernel_id> BuiltinKernelIds =
525+ MyDevice .get_info<info::device::built_in_kernel_ids>();
526+ kernel_bundle<bundle_state::executable> MyBundle =
527+ get_kernel_bundle<sycl::bundle_state::executable>(MyContext , { MyDevice }, BuiltinKernelIds );
520528
521- kernel builtinKernelA = myBundle .get_kernel(builtinKernelIds [0]);
522- kernel builtinKernelB = myBundle .get_kernel(builtinKernelIds [1]);
529+ kernel BuiltinKernelA = MyBundle .get_kernel(BuiltinKernelIds [0]);
530+ kernel BuiltinKernelB = MyBundle .get_kernel(BuiltinKernelIds [1]);
523531
524532// Create a dynamic parameter with an initial value of PtrA
525- exp_ext ::dynamic_parameter DynamicPointerArg{Graph, PtrA};
533+ sycl_ext ::dynamic_parameter DynamicPointerArg{Graph, PtrA};
526534
527535// Create command groups for both kernels which use DynamicPointerArg
528536auto CgfA = [&](handler &cgh) {
529537 cgh.set_arg(0, DynamicPointerArg);
530- cgh.parallel_for(range {n }, builtinKernelA );
538+ cgh.parallel_for(range {N }, BuiltinKernelA );
531539};
532540
533541auto CgfB = [&](handler &cgh) {
534542 cgh.set_arg(0, DynamicPointerArg);
535- cgh.parallel_for(range {n / 2}, builtinKernelB );
543+ cgh.parallel_for(range {N / 2}, BuiltinKernelB );
536544};
537545
538546// Construct a dynamic command-group with CgfA as the active cgf (index 0).
539- auto DynamicCG = exp_ext ::dynamic_command_group(Graph, {CgfA, CgfB});
547+ auto DynamicCG = sycl_ext ::dynamic_command_group(Graph, {CgfA, CgfB});
540548
541549// Create a dynamic command-group graph node.
542550auto DynamicCGNode = Graph.add(DynamicCG);
543551
544- auto ExecGraph = Graph.finalize(exp_ext ::property::graph::updatable{});
552+ auto ExecGraph = Graph.finalize(sycl_ext ::property::graph::updatable{});
545553
546554// The graph will execute CgfA with PtrA.
547555Queue.ext_oneapi_graph(ExecGraph).wait();
@@ -550,7 +558,7 @@ Queue.ext_oneapi_graph(ExecGraph).wait();
550558DynamicPointerArg.update(PtrB);
551559
552560// Sets CgfB as active in the dynamic command-group (index 1).
553- DynamicCG.set_active_cgf (1);
561+ DynamicCG.set_active_index (1);
554562
555563// Calls update to update the executable graph node with the changes to
556564// DynamicCG and DynamicPointerArg.
0 commit comments