From a7280e54e9497f71ecd88d8ab4dd911c02da6220 Mon Sep 17 00:00:00 2001 From: Victor Lomuller Date: Wed, 30 Apr 2025 13:07:59 +0100 Subject: [PATCH 1/5] [clang][SYCL] Do not decompose SYCL functors unless necessary The top level of SYCL functors are decomposed by default regardless of the content. The patch forces SYCL functors to only be decompose if there is a special type inside. --- clang/include/clang/Basic/LangOptions.def | 2 +- clang/include/clang/Driver/Options.td | 4 ++-- clang/lib/Sema/SemaSYCL.cpp | 3 +-- clang/test/SemaSYCL/no-decomp.cpp | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 99e39359ed21e..bfa31df24a189 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -312,7 +312,7 @@ ENUM_LANGOPT(SYCLVersion , SYCLMajorVersion, 2, SYCL_None, "Version of the SYCL LANGOPT(DeclareSPIRVBuiltins, 1, 0, "Declare SPIR-V builtin functions") LANGOPT(SYCLExplicitSIMD , 1, 0, "SYCL compilation with explicit SIMD extension") LANGOPT(EnableDAEInSpirKernels , 1, 0, "Enable Dead Argument Elimination in SPIR kernels") -LANGOPT(SYCLDecomposeStruct, 1, 1, "Force top level decomposition of SYCL functor") +LANGOPT(SYCLDecomposeStruct, 1, 0, "Force top level decomposition of SYCL functor") LANGOPT( SYCLValueFitInMaxInt, 1, 1, "SYCL compiler assumes value fits within MAX_INT for member function of " diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index d7e60e601293b..21055e8f4482c 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -7089,11 +7089,11 @@ defm sycl_instrument_device_code "(experimental)">>; defm sycl_decompose_functor : BoolFOption<"sycl-decompose-functor", - LangOpts<"SYCLDecomposeStruct">, DefaultTrue, + LangOpts<"SYCLDecomposeStruct">, DefaultFalse, PosFlag, NegFlag, BothFlags<[], [ClangOption, CLOption, CC1Option], - " decompose SYCL functor if possible (experimental, CUDA only)">>; + " decompose SYCL functor if possible (default is false)">>; defm sycl_cuda_compat : BoolFOption<"sycl-cuda-compatibility", LangOpts<"SYCLCUDACompat">, DefaultFalse, PosFlag Date: Fri, 2 May 2025 09:21:01 +0100 Subject: [PATCH 2/5] Update tests --- sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp | 5 ++++- .../Graph/Update/dyn_cgf_with_different_type_dyn_params.cpp | 5 ++++- sycl/test-e2e/Graph/Update/update_nullptr.cpp | 5 ++++- ...ate_with_indices_ptr_multiple_nodes_different_indices.cpp | 5 ++++- .../Graph/Update/update_with_indices_ptr_multiple_params.cpp | 5 ++++- sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp | 5 ++++- sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp | 5 ++++- sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp | 2 +- .../Tracing/usm/queue_single_task_released_pointer.cpp | 2 +- 9 files changed, 30 insertions(+), 9 deletions(-) diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp index 5aa691b9c36ae..0675576e4e087 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp @@ -1,4 +1,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out // RUN: env SYCL_UR_TRACE=2 %{run} %t.out | FileCheck %s // 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 env SYCL_UR_TRACE=2 %{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..663eb9413c9f3 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,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -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..787ae75ca048b 100644 --- a/sycl/test-e2e/Graph/Update/update_nullptr.cpp +++ b/sycl/test-e2e/Graph/Update/update_nullptr.cpp @@ -1,4 +1,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -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..1cc2b45a13ed6 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,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -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..e869190937382 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,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -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..f19df4cda68cd 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,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -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..97209ce10b410 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,7 @@ -// RUN: %{build} -o %t.out +// By default functors are no longer decomposed preventing the use of set_arg in +// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// +// RUN: %{build} -fsycl-sycl-decompose-functor -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/Tracing/usm/queue_single_task_nullptr.cpp b/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp index ef8b98b98301f..34682a61cf62b 100644 --- a/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp @@ -1,5 +1,5 @@ // UNSUPPORTED: windows || target-amd -// RUN: %{build} -o %t.out +// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out // RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM usage diff --git a/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp b/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp index 4444ee1b7b903..c40d2bf557cd4 100644 --- a/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp @@ -1,5 +1,5 @@ // UNSUPPORTED: windows || hip -// RUN: %{build} -o %t.out +// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out // RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM usage From 39a119f98a51b55bebd64469e21eff015db40573 Mon Sep 17 00:00:00 2001 From: Victor Lomuller Date: Fri, 2 May 2025 21:29:58 +0100 Subject: [PATCH 3/5] fixes --- clang/lib/Sema/SemaSYCL.cpp | 4 +--- sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp | 4 ++-- .../Graph/Update/dyn_cgf_with_different_type_dyn_params.cpp | 4 ++-- sycl/test-e2e/Graph/Update/update_nullptr.cpp | 4 ++-- ...date_with_indices_ptr_multiple_nodes_different_indices.cpp | 4 ++-- .../Graph/Update/update_with_indices_ptr_multiple_params.cpp | 4 ++-- sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp | 4 ++-- sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp | 4 ++-- sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp | 2 +- .../Tracing/usm/queue_single_task_released_pointer.cpp | 2 +- 10 files changed, 17 insertions(+), 19 deletions(-) diff --git a/clang/lib/Sema/SemaSYCL.cpp b/clang/lib/Sema/SemaSYCL.cpp index 8d85a96bba113..83d7ae630f4ae 100644 --- a/clang/lib/Sema/SemaSYCL.cpp +++ b/clang/lib/Sema/SemaSYCL.cpp @@ -319,9 +319,7 @@ ExprResult SemaSYCL::BuildSYCLBuiltinBaseTypeExpr(SourceLocation Loc, /// Returns true if the target requires a new type. /// This happens if a pointer to generic cannot be passed -static bool targetRequiresNewType(ASTContext &Context) { - return false; -} +static bool targetRequiresNewType(ASTContext &Context) { return false; } // This information is from Section 4.13 of the SYCL spec // https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf diff --git a/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp b/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp index 0675576e4e087..31bc42eea6742 100644 --- a/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp +++ b/sycl/test-e2e/Graph/Update/dyn_cgf_different_arg_nums.cpp @@ -1,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: env SYCL_UR_TRACE=2 %{run} %t.out | FileCheck %s // 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 env SYCL_UR_TRACE=2 %{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 663eb9413c9f3..8953c37bd917f 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,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -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 787ae75ca048b..9e155a7b546ea 100644 --- a/sycl/test-e2e/Graph/Update/update_nullptr.cpp +++ b/sycl/test-e2e/Graph/Update/update_nullptr.cpp @@ -1,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -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 1cc2b45a13ed6..aa5b715cd4b2c 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,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -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 e869190937382..9723a03bab2a8 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,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -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 f19df4cda68cd..41441d5408e6a 100644 --- a/sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp +++ b/sycl/test-e2e/Graph/Update/update_with_indices_scalar.cpp @@ -1,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -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 97209ce10b410..c6dcc2caf82a8 100644 --- a/sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp +++ b/sycl/test-e2e/Graph/Update/whole_update_dynamic_param.cpp @@ -1,7 +1,7 @@ // By default functors are no longer decomposed preventing the use of set_arg in -// this test, -fsycl-sycl-decompose-functor is used to force the old behavior +// this test, -fsycl-decompose-functor is used to force the old behavior // -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -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/Tracing/usm/queue_single_task_nullptr.cpp b/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp index 34682a61cf62b..fadfc0c035d69 100644 --- a/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_single_task_nullptr.cpp @@ -1,5 +1,5 @@ // UNSUPPORTED: windows || target-amd -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM usage diff --git a/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp b/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp index c40d2bf557cd4..8ec486a83d485 100644 --- a/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp +++ b/sycl/test-e2e/Tracing/usm/queue_single_task_released_pointer.cpp @@ -1,5 +1,5 @@ // UNSUPPORTED: windows || hip -// RUN: %{build} -fsycl-sycl-decompose-functor -o %t.out +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: not --crash env SYCL_TRACE_TERMINATE_ON_WARNING=1 %{run} sycl-trace --verify %t.out | FileCheck %s // Test parameter analysis of USM usage From 47df942561ad33614612d441ba63a568a16a0457 Mon Sep 17 00:00:00 2001 From: Victor Lomuller Date: Fri, 2 May 2025 21:48:08 +0100 Subject: [PATCH 4/5] fix more test --- .../extensions/properties/properties_cache_control.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sycl/test/check_device_code/extensions/properties/properties_cache_control.cpp b/sycl/test/check_device_code/extensions/properties/properties_cache_control.cpp index cf853d2a6c7ac..58bf4fd9a084e 100644 --- a/sycl/test/check_device_code/extensions/properties/properties_cache_control.cpp +++ b/sycl/test/check_device_code/extensions/properties/properties_cache_control.cpp @@ -82,19 +82,19 @@ void cache_control_read_write_func() { } // CHECK-IR: spir_kernel{{.*}}cache_control_read_hint_func -// CHECK-IR: {{.*}}addrspacecast ptr addrspace(1){{.*}}!spirv.Decorations [[RHINT:.*]] +// CHECK-IR: {{.*}}load ptr addrspace(4), ptr{{.*}}!spirv.Decorations [[RHINT:.*]] // CHECK-IR: ret void // CHECK-IR: spir_kernel{{.*}}cache_control_read_assertion_func -// CHECK-IR: {{.*}}addrspacecast ptr addrspace(1){{.*}}!spirv.Decorations [[RASSERT:.*]] +// CHECK-IR: {{.*}}load ptr addrspace(4), ptr{{.*}}!spirv.Decorations [[RASSERT:.*]] // CHECK-IR: ret void // CHECK-IR: spir_kernel{{.*}}cache_control_write_hint_func -// CHECK-IR: {{.*}}addrspacecast ptr addrspace(1){{.*}}!spirv.Decorations [[WHINT:.*]] +// CHECK-IR: {{.*}}load ptr addrspace(4), ptr{{.*}}!spirv.Decorations [[WHINT:.*]] // CHECK-IR: ret void // CHECK-IR: spir_kernel{{.*}}cache_control_read_write_func -// CHECK-IR: {{.*}}addrspacecast ptr addrspace(1){{.*}}!spirv.Decorations [[RWHINT:.*]] +// CHECK-IR: {{.*}}load ptr addrspace(4), ptr{{.*}}!spirv.Decorations [[RWHINT:.*]] // CHECK-IR: ret void // CHECK-IR: [[RHINT]] = !{[[RHINT1:.*]], [[RHINT2:.*]], [[RHINT3:.*]]} From f617c4a19e81d66f71b2942abc35f4a882c00a00 Mon Sep 17 00:00:00 2001 From: Victor Lomuller Date: Mon, 5 May 2025 16:18:32 +0100 Subject: [PATCH 5/5] work around tests --- sycl/test-e2e/ESIMD/lsc/lsc_load_store_2d_smoke.cpp | 4 +++- sycl/test-e2e/ESIMD/unified_memory_api/scatter_usm.cpp | 4 +++- sycl/test-e2e/ESIMD/usm_gather_scatter_rgba.cpp | 4 +++- sycl/test-e2e/ESIMD/usm_gather_scatter_rgba_64.cpp | 4 +++- sycl/test-e2e/ESIMD/vadd_raw_send_gen12.cpp | 4 +++- sycl/test-e2e/XPTI/basic_event_collection_linux.cpp | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sycl/test-e2e/ESIMD/lsc/lsc_load_store_2d_smoke.cpp b/sycl/test-e2e/ESIMD/lsc/lsc_load_store_2d_smoke.cpp index 940e6f7793256..afbc09c862be2 100644 --- a/sycl/test-e2e/ESIMD/lsc/lsc_load_store_2d_smoke.cpp +++ b/sycl/test-e2e/ESIMD/lsc/lsc_load_store_2d_smoke.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// // REQUIRES: arch-intel_gpu_pvc // REQUIRES-INTEL-DRIVER: lin: 30508 -// RUN: %{build} -o %t.out +// Shouldn't have to use -fsycl-decompose-functor, +// See https://github.com/intel/llvm-test-suite/issues/18317 +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: %{run} %t.out // Basic test for new lsc_load_2d/lsc_store_2d API. diff --git a/sycl/test-e2e/ESIMD/unified_memory_api/scatter_usm.cpp b/sycl/test-e2e/ESIMD/unified_memory_api/scatter_usm.cpp index ff331a421ccef..ec6f7c480cee1 100644 --- a/sycl/test-e2e/ESIMD/unified_memory_api/scatter_usm.cpp +++ b/sycl/test-e2e/ESIMD/unified_memory_api/scatter_usm.cpp @@ -5,7 +5,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===------------------------------------------------------------------===// -// RUN: %{build} -fsycl-device-code-split=per_kernel -D__ESIMD_GATHER_SCATTER_LLVM_IR -o %t.out +// Shouldn't have to use -fsycl-decompose-functor, +// See https://github.com/intel/llvm-test-suite/issues/18317 +// RUN: %{build} -fsycl-device-code-split=per_kernel -fsycl-decompose-functor -D__ESIMD_GATHER_SCATTER_LLVM_IR -o %t.out // RUN: %{run} %t.out // The test verifies esimd::scatter() functions accepting USM pointer diff --git a/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba.cpp b/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba.cpp index f3239439a594d..cd450ca85811c 100644 --- a/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba.cpp +++ b/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba.cpp @@ -5,7 +5,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// RUN: %{build} -o %t.out +// Shouldn't have to use -fsycl-decompose-functor, +// See https://github.com/intel/llvm-test-suite/issues/18317 +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: %{run} %t.out // // The test checks functionality of the gather_rgba/scatter_rgba USM-based ESIMD diff --git a/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba_64.cpp b/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba_64.cpp index 4b0bbcf6baada..1f5dedb1e7502 100644 --- a/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba_64.cpp +++ b/sycl/test-e2e/ESIMD/usm_gather_scatter_rgba_64.cpp @@ -5,7 +5,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// RUN: %{build} -o %t.out +// Shouldn't have to use -fsycl-decompose-functor, +// See https://github.com/intel/llvm-test-suite/issues/18317 +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: %{run} %t.out // // The test checks functionality of the gather_rgba/scatter_rgba USM-based ESIMD diff --git a/sycl/test-e2e/ESIMD/vadd_raw_send_gen12.cpp b/sycl/test-e2e/ESIMD/vadd_raw_send_gen12.cpp index d46907dae5bdc..ef5d2e598e12c 100644 --- a/sycl/test-e2e/ESIMD/vadd_raw_send_gen12.cpp +++ b/sycl/test-e2e/ESIMD/vadd_raw_send_gen12.cpp @@ -6,7 +6,9 @@ // //===---------------------------------------------------------===// // REQUIRES: gpu-intel-gen12 -// RUN: %{build} -o %t.out +// Shouldn't have to use -fsycl-decompose-functor, +// See https://github.com/intel/llvm-test-suite/issues/18317 +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: %{run} %t.out #include "esimd_test_utils.hpp" diff --git a/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp b/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp index 4dfe5928bd5ee..f899caf6cfbca 100644 --- a/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp +++ b/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp @@ -1,6 +1,6 @@ // REQUIRES: xptifw, opencl, cpu, linux // RUN: %build_collector -// RUN: %{build} -o %t.out +// RUN: %{build} -fsycl-decompose-functor -o %t.out // RUN: env UR_ENABLE_LAYERS=UR_LAYER_TRACING env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s #include "basic_event_collection.inc"