From f74b338a3d3b805fc4856123b6c7b23328b2030b Mon Sep 17 00:00:00 2001 From: Ben Tracy Date: Fri, 25 Apr 2025 15:01:40 +0100 Subject: [PATCH 1/3] [SYCL][Graph] Deprecate dynamic_parameter constructors that take a graph - Tying a dynamic param to a specific graph has no practical purpose and prevents whole graph update usage, so this is the first step to removing it - Remove error wording from spec about using dynamic params across multiple graphs - Deprecate old constructors and add new ones under breaking changes macro. - Ignore graph parameter for current constructors since it is no longer stored. - Update tests to ignore deprecation warnings under werror --- .../sycl_ext_oneapi_graph.asciidoc | 12 +-- .../sycl/ext/oneapi/experimental/graph.hpp | 51 +++++++++++++ sycl/source/detail/graph_impl.cpp | 18 +++-- sycl/source/detail/graph_impl.hpp | 18 ++--- sycl/source/handler.cpp | 6 -- .../dyn_work_group_memory_basic.cpp | 2 +- .../update_before_finalize.cpp | 2 +- ...date_with_indices_multiple_exec_graphs.cpp | 2 +- .../update_with_indices_ordering.cpp | 2 +- .../update_with_indices_ptr.cpp | 2 +- .../update_with_indices_ptr_3D.cpp | 2 +- .../update_with_indices_ptr_double_update.cpp | 2 +- ...update_with_indices_ptr_multiple_nodes.cpp | 2 +- ...pdate_with_indices_ptr_multiple_params.cpp | 2 +- .../update_with_indices_ptr_subgraph.cpp | 2 +- .../update_with_indices_scalar.cpp | 2 +- .../Update/dyn_cgf_with_all_dyn_params.cpp | 2 +- ...dyn_cgf_with_different_type_dyn_params.cpp | 2 +- .../dyn_cgf_with_dyn_work_group_mem.cpp | 2 +- .../Update/dyn_cgf_with_some_dyn_params.cpp | 2 +- .../Update/dyn_work_group_memory_basic.cpp | 2 +- .../Update/dyn_work_group_memory_multiple.cpp | 2 +- .../dyn_work_group_memory_multiple_graphs.cpp | 76 +++++++++++++++++++ .../dyn_work_group_memory_multiple_nodes.cpp | 2 +- .../Graph/Update/update_before_finalize.cpp | 2 +- sycl/test-e2e/Graph/Update/update_nullptr.cpp | 2 +- .../Update/update_with_indices_accessor.cpp | 2 +- ...te_with_indices_accessor_double_update.cpp | 2 +- ...essor_multiple_nodes_different_indices.cpp | 2 +- .../update_with_indices_accessor_ordering.cpp | 2 +- .../update_with_indices_accessor_spv.cpp | 2 +- ...date_with_indices_multiple_exec_graphs.cpp | 2 +- .../Update/update_with_indices_ordering.cpp | 2 +- .../Graph/Update/update_with_indices_ptr.cpp | 2 +- .../Update/update_with_indices_ptr_3D.cpp | 2 +- .../update_with_indices_ptr_double_update.cpp | 2 +- ...update_with_indices_ptr_multiple_nodes.cpp | 2 +- ...s_ptr_multiple_nodes_different_indices.cpp | 2 +- ...pdate_with_indices_ptr_multiple_params.cpp | 2 +- .../update_with_indices_ptr_subgraph.cpp | 2 +- .../Update/update_with_indices_scalar.cpp | 2 +- .../Update/update_with_raw_kernel_arg.cpp | 2 +- .../Update/whole_update_dynamic_param.cpp | 2 +- ...tic_memory_with_dyn_cgf_and_dyn_params.cpp | 2 +- .../Extensions/CommandGraph/Update.cpp | 8 +- 45 files changed, 190 insertions(+), 75 deletions(-) create mode 100644 sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc index ccdcf50049fee..4e9325015edc5 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc @@ -527,6 +527,10 @@ dynamic_parameter(command_graph graph, |Constructs a dynamic parameter object that can be registered with command graph nodes with an initial value. +[Note: This constructor which takes a graph has been deprecated and will be +replaced in the next ABI breaking window. The new constructor will not associate +a dynamic parameter with any specific graph. -- end note] + Parameters: * `graph` - Graph containing the nodes which will have dynamic parameters. @@ -1936,10 +1940,6 @@ a command-group submitted to a queue with is currently recording to a graph. * Throws synchronously with error code `invalid` if this function is called from a normal SYCL command-group submission. -* Throws synchronously with error code `invalid` if the graph which will be -associated with the graph node resulting from this command-group submission is -different from the one with which `dynamicParameterAcc` was created. - | [source,c++] ---- @@ -1966,10 +1966,6 @@ a command-group submitted to a queue with is currently recording to a graph. * Throws synchronously with error code `invalid` if this function is called from a normal SYCL command-group submission. -* Throws synchronously with error code `invalid` if the graph which will be -associated with the graph node resulting from this command-group submission is -different from the one with which the dynamic_parameter was created. - |=== === Thread Safety diff --git a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp index 53800bbfb4380..6d0f50c224756 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp @@ -504,10 +504,26 @@ class command_graph namespace detail { class __SYCL_EXPORT dynamic_parameter_base { public: +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + dynamic_parameter_base(size_t ParamSize, const void *Data); + dynamic_parameter_base(); +#else dynamic_parameter_base() = default; +#endif + +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES + __SYCL_DEPRECATED("Dynamic_parameter constructors taking a graph object have " + "been deprecated " + "and will be removed in the next ABI breaking window.") +#endif dynamic_parameter_base( sycl::ext::oneapi::experimental::command_graph Graph); +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES + __SYCL_DEPRECATED("Dynamic_parameter constructors taking a graph object have " + "been deprecated " + "and will be removed in the next ABI breaking window.") +#endif dynamic_parameter_base( sycl::ext::oneapi::experimental::command_graph Graph, @@ -550,10 +566,18 @@ class dynamic_work_group_memory_base public: dynamic_work_group_memory_base() = default; #ifndef __SYCL_DEVICE_ONLY__ +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + + dynamic_work_group_memory_base(size_t Size) + : dynamic_parameter_base(), BufferSize(Size) {} +#endif +// TODO: Remove in next ABI breaking window dynamic_work_group_memory_base( experimental::command_graph Graph, size_t Size) : dynamic_parameter_base(Graph), BufferSize(Size) {} #else + dynamic_work_group_memory_base(size_t Size) + : BufferSize(Size) {} dynamic_work_group_memory_base( experimental::command_graph /*Graph*/, size_t Size) @@ -586,6 +610,19 @@ __SYCL_TYPE(dynamic_work_group_memory) dynamic_work_group_memory // closed. dynamic_work_group_memory() = default; +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + /// Constructs a new dynamic_work_group_memory object. + /// @param Num Number of elements in the unbounded array DataT. + dynamic_work_group_memory(size_t Num) + : detail::dynamic_work_group_memory_base( + Num * sizeof(std::remove_extent_t)) {} +#endif + +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES + __SYCL_DEPRECATED("Dynamic_work_group_memory constructors taking a graph " + "object have been deprecated " + "and will be removed in the next ABI breaking window.") +#endif /// Constructs a new dynamic_work_group_memory object. /// @param Graph The graph associated with this object. /// @param Num Number of elements in the unbounded array DataT. @@ -636,6 +673,20 @@ class dynamic_parameter : public detail::dynamic_parameter_base { : sycl::detail::kernel_param_kind_t::kind_std_layout; public: +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES +/// Constructs a new dynamic parameter. +/// @param Graph The graph associated with this parameter. +/// @param Param A reference value for this parameter used for CTAD. +dynamic_parameter(const ValueT &Param) + : detail::dynamic_parameter_base(sizeof(ValueT), &Param) {} + +#endif + +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES + __SYCL_DEPRECATED("Dynamic_parameter constructors taking a graph object have " + "been deprecated " + "and will be removed in the next ABI breaking window.") +#endif /// Constructs a new dynamic parameter. /// @param Graph The graph associated with this parameter. /// @param Param A reference value for this parameter used for CTAD. diff --git a/sycl/source/detail/graph_impl.cpp b/sycl/source/detail/graph_impl.cpp index 8cb8647c49ee9..1d147449f1ff0 100644 --- a/sycl/source/detail/graph_impl.cpp +++ b/sycl/source/detail/graph_impl.cpp @@ -1969,16 +1969,18 @@ void executable_command_graph::update(const std::vector &Nodes) { impl->update(NodeImpls); } -dynamic_parameter_base::dynamic_parameter_base( - command_graph Graph) - : impl(std::make_shared( - sycl::detail::getSyclObjImpl(Graph))) {} +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES +dynamic_parameter_base::dynamic_parameter_base() + : impl(std::make_shared()) {} +#endif + +dynamic_parameter_base::dynamic_parameter_base( + command_graph) + : impl(std::make_shared()) {} dynamic_parameter_base::dynamic_parameter_base( - command_graph Graph, size_t ParamSize, - const void *Data) - : impl(std::make_shared( - sycl::detail::getSyclObjImpl(Graph), ParamSize, Data)) {} + command_graph, size_t ParamSize, const void *Data) + : impl(std::make_shared(ParamSize, Data)) {} void dynamic_parameter_base::updateValue(const void *NewValue, size_t Size) { impl->updateValue(NewValue, Size); diff --git a/sycl/source/detail/graph_impl.hpp b/sycl/source/detail/graph_impl.hpp index 3234721626a10..26cf5d422f8c6 100644 --- a/sycl/source/detail/graph_impl.hpp +++ b/sycl/source/detail/graph_impl.hpp @@ -1485,23 +1485,19 @@ class exec_graph_impl { class dynamic_parameter_impl { public: - dynamic_parameter_impl(std::shared_ptr GraphImpl) - : MGraph(GraphImpl), - MID(NextAvailableID.fetch_add(1, std::memory_order_relaxed)) {} + dynamic_parameter_impl() + : MID(NextAvailableID.fetch_add(1, std::memory_order_relaxed)) {} - dynamic_parameter_impl(std::shared_ptr GraphImpl, - size_t ParamSize, const void *Data) - : MGraph(GraphImpl), MValueStorage(ParamSize), + dynamic_parameter_impl(size_t ParamSize, const void *Data) + : MValueStorage(ParamSize), MID(NextAvailableID.fetch_add(1, std::memory_order_relaxed)) { std::memcpy(MValueStorage.data(), Data, ParamSize); } /// sycl_ext_oneapi_raw_kernel_arg constructor /// Parameter size is taken from member of raw_kernel_arg object. - dynamic_parameter_impl(std::shared_ptr GraphImpl, size_t, - raw_kernel_arg *Data) - : MGraph(GraphImpl), - MID(NextAvailableID.fetch_add(1, std::memory_order_relaxed)) { + dynamic_parameter_impl(size_t, raw_kernel_arg *Data) + : MID(NextAvailableID.fetch_add(1, std::memory_order_relaxed)) { size_t RawArgSize = Data->MArgSize; const void *RawArgData = Data->MArgData; MValueStorage.reserve(RawArgSize); @@ -1594,8 +1590,6 @@ class dynamic_parameter_impl { std::vector, int>> MNodes; // Dynamic command-groups which will be updated std::vector MDynCGs; - - std::weak_ptr MGraph; std::vector MValueStorage; private: diff --git a/sycl/source/handler.cpp b/sycl/source/handler.cpp index 7c8537b3b9352..23bfb236e995e 100644 --- a/sycl/source/handler.cpp +++ b/sycl/source/handler.cpp @@ -2158,12 +2158,6 @@ void handler::registerDynamicParameter( } auto Paraimpl = detail::getSyclObjImpl(DynamicParamBase); - if (Paraimpl->MGraph.lock() != this->impl->MGraph) { - throw sycl::exception( - make_error_code(errc::invalid), - "Cannot use a Dynamic Parameter with a node associated with a graph " - "other than the one it was created with."); - } impl->MDynamicParameters.emplace_back(Paraimpl.get(), ArgIndex); } diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/dyn_work_group_memory_basic.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/dyn_work_group_memory_basic.cpp index 92dfb36f7de85..910034cd15589 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/dyn_work_group_memory_basic.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/dyn_work_group_memory_basic.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_before_finalize.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_before_finalize.cpp index 7389d85a63740..211bc8d37bd04 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_before_finalize.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_before_finalize.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_multiple_exec_graphs.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_multiple_exec_graphs.cpp index f52e4d101661c..6de8bfbe03965 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_multiple_exec_graphs.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_multiple_exec_graphs.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ordering.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ordering.cpp index b529c505e9322..b3152fa1527c1 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ordering.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ordering.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr.cpp index 2515662692be6..d4452ab6e2a6b 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_3D.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_3D.cpp index c15c37fe8fa65..820b5b81793a9 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_3D.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_3D.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_double_update.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_double_update.cpp index 73829d8869161..8a0a86253542f 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_double_update.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_double_update.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_nodes.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_nodes.cpp index 64aff5376fd38..3247b7edf27a0 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_nodes.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_nodes.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_params.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_params.cpp index 0e13a56026d47..0c01f44bc4333 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_params.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_multiple_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_subgraph.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_subgraph.cpp index 91f36864b1ffb..0a9d4eb9372e2 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_subgraph.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_ptr_subgraph.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_scalar.cpp b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_scalar.cpp index 99ebec7c562f3..7f141555493a0 100644 --- a/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_scalar.cpp +++ b/sycl/test-e2e/Graph/Update/FreeFunctionKernels/update_with_indices_scalar.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp index 06050d8750141..9ae0ebcaa0413 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_with_different_type_dyn_params.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_with_different_type_dyn_params.cpp index 65d27070a1b0c..19f36ca6cfe6e 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_with_different_type_dyn_params.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_with_different_type_dyn_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_with_dyn_work_group_mem.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_with_dyn_work_group_mem.cpp index 1d5d57b98af78..0e48e28eb8c39 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_with_dyn_work_group_mem.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_with_dyn_work_group_mem.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_with_some_dyn_params.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_with_some_dyn_params.cpp index c6c639a83cf91..990c8762836f9 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_with_some_dyn_params.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_with_some_dyn_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_basic.cpp b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_basic.cpp index a8e52dff397db..7d900bb0c8c03 100644 --- a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_basic.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_basic.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple.cpp b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple.cpp index 8d478a961385a..5caefe91d88e9 100644 --- a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp new file mode 100644 index 0000000000000..e92ab7ae286b7 --- /dev/null +++ b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp @@ -0,0 +1,76 @@ +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out +// RUN: %{run} %t.out +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} +// Extra run to check for immediate-command-list in Level Zero +// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} + +// Requires constructors that don't take a graph which is currently guarded by the breaking changes macro +//REQUIRES: preview-mode + +// Tests using dynamic_work_group_memory in a whole graph update graph. + +#include "../graph_common.hpp" +#include + +int main() { + queue Queue{}; + + using T = int; + constexpr int LocalSize{16}; + + T *Ptr = malloc_device(Size, Queue); + std::vector HostData(Size); + std::vector HostOutputCompare(Size, LocalSize * LocalSize); + + Queue.memset(Ptr, 0, Size * sizeof(T)).wait(); + + exp_ext::command_graph GraphA{Queue.get_context(), Queue.get_device()}; + + exp_ext::dynamic_work_group_memory DynLocalMem(LocalSize); + + auto KernelLambda = [=](nd_item<1> Item) { + size_t GlobalID = Item.get_global_id(); + auto LocalRange = Item.get_local_range(0); + + auto LocalMem = DynLocalMem.get(); + + LocalMem[Item.get_local_id()] = LocalRange; + group_barrier(Item.get_group()); + + for (size_t i{0}; i < LocalRange; ++i) { + Ptr[GlobalID] += LocalMem[i]; + } + }; + + nd_range<1> NDrangeA{Size, LocalSize}; + GraphA.add([&](handler &CGH) { CGH.parallel_for(NDrangeA, KernelLambda); }); + + auto GraphExecA = GraphA.finalize(); + Queue.ext_oneapi_graph(GraphExecA).wait(); + + Queue.copy(Ptr, HostData.data(), Size).wait(); + for (size_t i = 0; i < Size; i++) { + assert(check_value(i, HostData[i], HostOutputCompare[i], "HostData")); + } + + constexpr int NewLocalSize{64}; + DynLocalMem.update(NewLocalSize); + exp_ext::command_graph GraphB{Queue.get_context(), Queue.get_device()}; + + nd_range<1> NDrangeB{Size, NewLocalSize}; + GraphB.add([&](handler &CGH) { CGH.parallel_for(NDrangeB, KernelLambda); }); + + auto GraphExecB = GraphB.finalize(exp_ext::property::graph::updatable{}); + GraphExecB.update(GraphA); + + Queue.memset(Ptr, 0, Size * sizeof(T)).wait(); + Queue.ext_oneapi_graph(GraphExecB).wait(); + + Queue.copy(Ptr, HostData.data(), Size).wait(); + for (size_t i = 0; i < Size; i++) { + assert(check_value(i, HostData[i], HostOutputCompare[i], "HostData")); + } + + return 0; +} diff --git a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_nodes.cpp b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_nodes.cpp index b5955113e23e7..d25db1ef6c45d 100644 --- a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_nodes.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_nodes.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_before_finalize.cpp b/sycl/test-e2e/Graph/Update/update_before_finalize.cpp index 684cd1104ea00..14d00e3b3763d 100644 --- a/sycl/test-e2e/Graph/Update/update_before_finalize.cpp +++ b/sycl/test-e2e/Graph/Update/update_before_finalize.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_nullptr.cpp b/sycl/test-e2e/Graph/Update/update_nullptr.cpp index 060386c6659a3..6b7c4003b5ea6 100644 --- a/sycl/test-e2e/Graph/Update/update_nullptr.cpp +++ b/sycl/test-e2e/Graph/Update/update_nullptr.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_accessor.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_accessor.cpp index 024e76e9001a5..d52a99042ff96 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_accessor.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_accessor.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_double_update.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_double_update.cpp index 523e8b643f7c2..5f1e4f4b43b5f 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_double_update.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_double_update.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_multiple_nodes_different_indices.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_multiple_nodes_different_indices.cpp index 348998cf1781d..1223d872cfc18 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_multiple_nodes_different_indices.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_multiple_nodes_different_indices.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_ordering.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_ordering.cpp index 57a1281db35ff..029dbc1b1d710 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_ordering.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_ordering.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_spv.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_spv.cpp index a9ce1a892f767..9b69121f44bfb 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_accessor_spv.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_accessor_spv.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out %S/../Inputs/Kernels/update_with_indices_accessor.spv // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out %S/../Inputs/Kernels/update_with_indices_accessor.spv 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_multiple_exec_graphs.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_multiple_exec_graphs.cpp index 1e24049ef2f6f..dc71c041dd2f8 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_multiple_exec_graphs.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_multiple_exec_graphs.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ordering.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ordering.cpp index 5a9de103053eb..d73b1e69ae61d 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ordering.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ordering.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr.cpp index ff0d3dbe1a82f..ae394742d84ef 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_3D.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_3D.cpp index 5459eb42de8d4..fd94b8c139297 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_3D.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_3D.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_double_update.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_double_update.cpp index ffffb05061789..e2f2cb6253123 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_double_update.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_double_update.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes.cpp index 45b3df8e31535..cbf1fcd10db06 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes_different_indices.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes_different_indices.cpp index 0b5d97dffcccb..46f4751cdab77 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes_different_indices.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_nodes_different_indices.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_params.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_params.cpp index 212074b5450f3..7e92e7664b3cf 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_params.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_multiple_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_subgraph.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_subgraph.cpp index 7e191be3691ca..308e3839cfa94 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_ptr_subgraph.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_ptr_subgraph.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp b/sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp index 3c4bb8f189e7a..c38c94889fe15 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/update_with_raw_kernel_arg.cpp b/sycl/test-e2e/Graph/Update/update_with_raw_kernel_arg.cpp index 508288fcf0f9b..ce14436c9af91 100644 --- a/sycl/test-e2e/Graph/Update/update_with_raw_kernel_arg.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_raw_kernel_arg.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp b/sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp index b894685a8bd87..64e1d154ef886 100644 --- a/sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp +++ b/sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/work_group_static_memory_with_dyn_cgf_and_dyn_params.cpp b/sycl/test-e2e/Graph/Update/work_group_static_memory_with_dyn_cgf_and_dyn_params.cpp index 084be871046ee..79451d864a307 100644 --- a/sycl/test-e2e/Graph/Update/work_group_static_memory_with_dyn_cgf_and_dyn_params.cpp +++ b/sycl/test-e2e/Graph/Update/work_group_static_memory_with_dyn_cgf_and_dyn_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/unittests/Extensions/CommandGraph/Update.cpp b/sycl/unittests/Extensions/CommandGraph/Update.cpp index dc2bd0bb3e1ca..db0e04c0cccaa 100644 --- a/sycl/unittests/Extensions/CommandGraph/Update.cpp +++ b/sycl/unittests/Extensions/CommandGraph/Update.cpp @@ -28,14 +28,16 @@ TEST_F(CommandGraphTest, UpdatableException) { TEST_F(CommandGraphTest, DynamicParamRegister) { // Check that registering a dynamic param with a node from a graph that was - // not passed to its constructor throws. + // not passed to its constructor does not throw. + // TODO: Update test when deprecated constructors that take a graph have been + // removed. experimental::dynamic_parameter DynamicParam(Graph, int{}); auto OtherGraph = experimental::command_graph(Queue.get_context(), Queue.get_device()); auto Node = OtherGraph.add([&](sycl::handler &cgh) { - // This should throw since OtherGraph is not associated with DynamicParam - EXPECT_ANY_THROW(cgh.set_arg(0, DynamicParam)); + // This should not throw + EXPECT_NO_THROW(cgh.set_arg(0, DynamicParam)); cgh.single_task>([]() {}); }); } From d2f5d91b49965c97ab6277d7a8d1c0b8ba82bd62 Mon Sep 17 00:00:00 2001 From: Ben Tracy Date: Mon, 28 Apr 2025 12:44:55 +0100 Subject: [PATCH 2/3] Addressing review comments - Remove duplicate deprecations - Fix test formatting --- sycl/include/sycl/ext/oneapi/experimental/graph.hpp | 11 +---------- .../Graph/Update/dyn_cgf_with_all_dyn_params.cpp | 2 +- .../Update/dyn_work_group_memory_multiple_graphs.cpp | 5 +++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp index 6d0f50c224756..20f12fb2983ca 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp @@ -511,19 +511,10 @@ class __SYCL_EXPORT dynamic_parameter_base { dynamic_parameter_base() = default; #endif -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - __SYCL_DEPRECATED("Dynamic_parameter constructors taking a graph object have " - "been deprecated " - "and will be removed in the next ABI breaking window.") -#endif dynamic_parameter_base( sycl::ext::oneapi::experimental::command_graph Graph); -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES - __SYCL_DEPRECATED("Dynamic_parameter constructors taking a graph object have " - "been deprecated " - "and will be removed in the next ABI breaking window.") -#endif + dynamic_parameter_base( sycl::ext::oneapi::experimental::command_graph Graph, diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp index 9ae0ebcaa0413..3207bca714605 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp @@ -1,4 +1,4 @@ -// RUN: %{build} -Wno-error=deprecated-declarations -Wno-error=deprecated-declarations -o %t.out +// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out // RUN: %{run} %t.out // Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} diff --git a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp index e92ab7ae286b7..555217ff60380 100644 --- a/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_work_group_memory_multiple_graphs.cpp @@ -5,8 +5,9 @@ // Extra run to check for immediate-command-list in Level Zero // RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} -// Requires constructors that don't take a graph which is currently guarded by the breaking changes macro -//REQUIRES: preview-mode +// Requires constructors that don't take a graph which is currently guarded by +// the breaking changes macro +// REQUIRES: preview-mode // Tests using dynamic_work_group_memory in a whole graph update graph. From 6b96334db551d56ed2e56c3f87a924f10898d178 Mon Sep 17 00:00:00 2001 From: Ben Tracy Date: Mon, 28 Apr 2025 12:53:07 +0100 Subject: [PATCH 3/3] Fix formatting --- .../sycl/ext/oneapi/experimental/graph.hpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp index 20f12fb2983ca..31c6c6447808b 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp @@ -562,13 +562,12 @@ class dynamic_work_group_memory_base dynamic_work_group_memory_base(size_t Size) : dynamic_parameter_base(), BufferSize(Size) {} #endif -// TODO: Remove in next ABI breaking window + // TODO: Remove in next ABI breaking window dynamic_work_group_memory_base( experimental::command_graph Graph, size_t Size) : dynamic_parameter_base(Graph), BufferSize(Size) {} #else - dynamic_work_group_memory_base(size_t Size) - : BufferSize(Size) {} + dynamic_work_group_memory_base(size_t Size) : BufferSize(Size) {} dynamic_work_group_memory_base( experimental::command_graph /*Graph*/, size_t Size) @@ -665,12 +664,11 @@ class dynamic_parameter : public detail::dynamic_parameter_base { public: #ifdef __INTEL_PREVIEW_BREAKING_CHANGES -/// Constructs a new dynamic parameter. -/// @param Graph The graph associated with this parameter. -/// @param Param A reference value for this parameter used for CTAD. -dynamic_parameter(const ValueT &Param) - : detail::dynamic_parameter_base(sizeof(ValueT), &Param) {} - + /// Constructs a new dynamic parameter. + /// @param Graph The graph associated with this parameter. + /// @param Param A reference value for this parameter used for CTAD. + dynamic_parameter(const ValueT &Param) + : detail::dynamic_parameter_base(sizeof(ValueT), &Param) {} #endif #ifndef __INTEL_PREVIEW_BREAKING_CHANGES