From 7093e257a54f0f8ec4897c6ab181553dd2696c4f Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Mon, 7 Oct 2024 13:22:02 -0700 Subject: [PATCH 1/2] [SYCL] Deprecate `__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__` The default was flipped in https://github.com/intel/llvm/pull/13055, we can deprecate now and remove during the next ABI breaking window. Also, guard with `__INTEL_PREVIEW_BREAKING_CHANGES` to ensure that removal will actually happen. --- sycl/include/CL/__spirv/spirv_ops.hpp | 10 +++++++++- sycl/test/warnings/variadic_ocl_printf.cpp | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 sycl/test/warnings/variadic_ocl_printf.cpp diff --git a/sycl/include/CL/__spirv/spirv_ops.hpp b/sycl/include/CL/__spirv/spirv_ops.hpp index 481ac16ec4f26..7b9b39d5f24b4 100644 --- a/sycl/include/CL/__spirv/spirv_ops.hpp +++ b/sycl/include/CL/__spirv/spirv_ops.hpp @@ -1365,7 +1365,15 @@ __clc_BarrierTestWait(int64_t *state, int64_t arrival) noexcept; __SYCL_CONVERGENT__ extern __DPCPP_SYCL_EXTERNAL __SYCL_EXPORT void __clc_BarrierArriveAndWait(int64_t *state) noexcept; -#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ +#if defined(__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__) && \ + !defined(__INTEL_PREVIEW_BREAKING_CHANGES) +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpedantic" +#warning \ + "__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ is deprecated and will be removed in a future release." +#pragma clang diagnostic pop +#endif extern __DPCPP_SYCL_EXTERNAL int __spirv_ocl_printf(const __attribute__((opencl_constant)) char *Format, ...); extern __DPCPP_SYCL_EXTERNAL int __spirv_ocl_printf(const char *Format, ...); diff --git a/sycl/test/warnings/variadic_ocl_printf.cpp b/sycl/test/warnings/variadic_ocl_printf.cpp new file mode 100644 index 0000000000000..74caff358136d --- /dev/null +++ b/sycl/test/warnings/variadic_ocl_printf.cpp @@ -0,0 +1,5 @@ +// RUN: %clangxx -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -fsycl -fsycl-device-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s + +// expected-warning@*:* {{__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ is deprecated and will be removed in a future release.}} +#include + From fd5aef8296db239eecead1bc5823f1b01e7aa6f7 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Tue, 8 Oct 2024 10:43:59 -0700 Subject: [PATCH 2/2] Disable the warning in E2E tests using deprecated functionality --- sycl/test-e2e/Basic/built-ins.cpp | 2 +- sycl/test-e2e/DeviceLib/built-ins/printf.cpp | 2 +- sycl/test-e2e/ESIMD/printf.cpp | 2 +- sycl/test-e2e/Printf/float.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins.cpp b/sycl/test-e2e/Basic/built-ins.cpp index 26caad78f0fa9..4d8f5dcc3fd41 100644 --- a/sycl/test-e2e/Basic/built-ins.cpp +++ b/sycl/test-e2e/Basic/built-ins.cpp @@ -1,7 +1,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out | FileCheck %s -// RUN: %{build} -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -o %t_var.out +// RUN: %{build} -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings -o %t_var.out // RUN: %{run} %t_var.out | FileCheck %s // Hits an assertion with AMD: diff --git a/sycl/test-e2e/DeviceLib/built-ins/printf.cpp b/sycl/test-e2e/DeviceLib/built-ins/printf.cpp index 77e06a57b7eb1..4d4f3becd11e1 100644 --- a/sycl/test-e2e/DeviceLib/built-ins/printf.cpp +++ b/sycl/test-e2e/DeviceLib/built-ins/printf.cpp @@ -5,7 +5,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out | FileCheck %s // -// RUN: %{build} -fsycl-device-code-split=per_kernel -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -o %t_var.out +// RUN: %{build} -fsycl-device-code-split=per_kernel -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings -o %t_var.out // RUN: %{run} %t_var.out | FileCheck %s #include diff --git a/sycl/test-e2e/ESIMD/printf.cpp b/sycl/test-e2e/ESIMD/printf.cpp index 0379996011fd1..8f828b5e69f81 100644 --- a/sycl/test-e2e/ESIMD/printf.cpp +++ b/sycl/test-e2e/ESIMD/printf.cpp @@ -10,7 +10,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out | FileCheck %s // -// RUN: %{build} -fsycl-device-code-split=per_kernel -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -o %t_var.out +// RUN: %{build} -fsycl-device-code-split=per_kernel -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings -o %t_var.out // RUN: %{run} %t_var.out | FileCheck %s // //===----------------------------------------------------------------------===// diff --git a/sycl/test-e2e/Printf/float.cpp b/sycl/test-e2e/Printf/float.cpp index bd46ac719db88..0643b06684860 100644 --- a/sycl/test-e2e/Printf/float.cpp +++ b/sycl/test-e2e/Printf/float.cpp @@ -9,7 +9,7 @@ // RUN: %{build} -o %t.out // RUN: %{run} %t.out | FileCheck %s // FIXME: Remove dedicated variadic printf testing once the option is removed. -// RUN: %{build} -o %t.nonvar.out -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ +// RUN: %{build} -o %t.nonvar.out -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings // RUN: %{run} %t.nonvar.out | FileCheck %s // FIXME: Remove dedicated constant address space testing once generic AS // support is considered stable.