Skip to content

Commit

Permalink
[SYCL] Deprecate __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ (#15623)
Browse files Browse the repository at this point in the history
The default was flipped in #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.
  • Loading branch information
aelovikov-intel authored Oct 10, 2024
1 parent fa1615e commit c99766a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
10 changes: 9 additions & 1 deletion sycl/include/CL/__spirv/spirv_ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...);
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/built-ins.cpp
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/built-ins/printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Printf/float.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions sycl/test/warnings/variadic_ocl_printf.cpp
Original file line number Diff line number Diff line change
@@ -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 <sycl/sycl.hpp>

0 comments on commit c99766a

Please sign in to comment.