Skip to content

Commit 7f105d1

Browse files
authored
[SYCL][ABI-break] Remove deprecated variadic printf implementation (#20800)
Co-authored-by: Steffen Larsen [email protected]
1 parent 667c45a commit 7f105d1

File tree

8 files changed

+0
-120
lines changed

8 files changed

+0
-120
lines changed

sycl/include/sycl/__spirv/spirv_ops.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -838,27 +838,13 @@ __clc_BarrierTestWait(int64_t *state, int64_t arrival) noexcept;
838838
__SYCL_CONVERGENT__ extern __DPCPP_SYCL_EXTERNAL __SYCL_EXPORT void
839839
__clc_BarrierArriveAndWait(int64_t *state) noexcept;
840840

841-
#if defined(__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__) && \
842-
!defined(__INTEL_PREVIEW_BREAKING_CHANGES)
843-
#if defined(__clang__)
844-
#pragma clang diagnostic push
845-
#pragma clang diagnostic ignored "-Wpedantic"
846-
#warning \
847-
"__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ is deprecated and will be removed in a future release."
848-
#pragma clang diagnostic pop
849-
#endif
850-
extern __DPCPP_SYCL_EXTERNAL int
851-
__spirv_ocl_printf(const __attribute__((opencl_constant)) char *Format, ...);
852-
extern __DPCPP_SYCL_EXTERNAL int __spirv_ocl_printf(const char *Format, ...);
853-
#else
854841
template <typename... Args>
855842
extern __DPCPP_SYCL_EXTERNAL int
856843
__spirv_ocl_printf(const __attribute__((opencl_constant)) char *Format,
857844
Args... args);
858845
template <typename... Args>
859846
extern __DPCPP_SYCL_EXTERNAL int __spirv_ocl_printf(const char *Format,
860847
Args... args);
861-
#endif
862848

863849
// Native builtin extension
864850

sycl/test-e2e/Basic/built-ins.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out | FileCheck %s
33

4-
// RUN: %{build} -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings -o %t_var.out
5-
// RUN: %{run} %t_var.out | FileCheck %s
6-
74
// Hits an assertion and kernel page fault with AMD:
85
// UNSUPPORTED: target-amd
96
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/14404
@@ -28,15 +25,6 @@ static const CONSTANT char format[] = "Hello, World! %d %f\n";
2825
int main() {
2926
s::queue q{};
3027

31-
#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
32-
if (!q.get_device().has(sycl::aspect::fp64)) {
33-
std::cout << "Test with __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ defined is "
34-
"skipped because the device did not have fp64."
35-
<< std::endl;
36-
return 0;
37-
}
38-
#endif
39-
4028
// Test printf
4129
q.submit([&](s::handler &CGH) {
4230
CGH.single_task<class printf>([=]() {

sycl/test-e2e/DeviceLib/built-ins/printf.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
//
55
// RUN: %{build} -o %t.out
66
// RUN: %{run} %t.out | FileCheck %s
7-
//
8-
// RUN: %{build} -fsycl-device-code-split=per_kernel -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings -o %t_var.out
9-
// RUN: %{run} %t_var.out | FileCheck %s
107

118
#include <sycl/detail/core.hpp>
129
#include <sycl/ext/oneapi/experimental/builtins.hpp>
@@ -98,13 +95,6 @@ int main() {
9895
Queue.wait();
9996
}
10097

101-
#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
102-
// Currently printf will promote floating point values to doubles.
103-
// __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ changes the behavior to use
104-
// a variadic function, so if it is defined it will promote the floating
105-
// point arguments.
106-
if (Queue.get_device().has(sycl::aspect::fp64))
107-
#endif // __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
10898
{
10999
Queue.submit([&](handler &CGH) {
110100
CGH.single_task<class floating_points>([=]() {
@@ -120,12 +110,6 @@ int main() {
120110
});
121111
Queue.wait();
122112
}
123-
#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
124-
else {
125-
std::cout << "Skipped floating point test." << std::endl;
126-
std::cout << "Skipped floating point test." << std::endl;
127-
}
128-
#endif // __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
129113
// CHECK-NEXT: {{(33.4|Skipped floating point test.)}}
130114
// CHECK-NEXT: {{(-33.4|Skipped floating point test.)}}
131115

sycl/test-e2e/ESIMD/printf.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
// RUN: %{build} -o %t.out
1111
// RUN: %{run} %t.out | FileCheck %s
1212
//
13-
// RUN: %{build} -fsycl-device-code-split=per_kernel -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings -o %t_var.out
14-
// RUN: %{run} %t_var.out | FileCheck %s
15-
//
1613
//===----------------------------------------------------------------------===//
1714
//
1815
// The test checks that ESIMD kernels support printf functionality.
@@ -67,13 +64,6 @@ int main() {
6764
Queue.wait();
6865
}
6966

70-
#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
71-
// Currently printf will promote floating point values to doubles.
72-
// __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ changes the behavior to use
73-
// a variadic function, so if it is defined it will promote the floating
74-
// point arguments.
75-
if (Queue.get_device().has(sycl::aspect::fp64))
76-
#endif // __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
7767
{
7868
Queue.submit([&](handler &CGH) {
7969
CGH.single_task<class floating_points>([=]() {
@@ -89,12 +79,6 @@ int main() {
8979
});
9080
Queue.wait();
9181
}
92-
#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
93-
else {
94-
std::cout << "Skipped floating point test." << std::endl;
95-
std::cout << "Skipped floating point test." << std::endl;
96-
}
97-
#endif // __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
9882
// CHECK-NEXT: {{(33.4|Skipped floating point test.)}}
9983
// CHECK-NEXT: {{(-33.4|Skipped floating point test.)}}
10084

sycl/test-e2e/Graph/AsyncAlloc/Inputs/async_alloc_device_memory_reuse_zero_init.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <sycl/ext/oneapi/experimental/async_alloc/memory_pool.hpp>
1010
#include <sycl/ext/oneapi/experimental/async_alloc/memory_pool_properties.hpp>
1111

12-
#define __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
13-
1412
using T = int;
1513
void add_nodes_to_graph(
1614
exp_ext::command_graph<exp_ext::graph_state::modifiable> &Graph,

sycl/test-e2e/Printf/float.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
//
99
// RUN: %{build} -o %t.out
1010
// RUN: %{run} %t.out | FileCheck %s
11-
// FIXME: Remove dedicated variadic printf testing once the option is removed.
12-
// RUN: %{build} -o %t.nonvar.out -D__SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__ -Wno-#warnings
13-
// RUN: %{run} %t.nonvar.out | FileCheck %s
1411
// FIXME: Remove dedicated constant address space testing once generic AS
1512
// support is considered stable.
1613
// RUN: %{build} -o %t.constant.out -DTEST_CONSTANT_AS
@@ -46,18 +43,6 @@ class FloatTest;
4643

4744
int main() {
4845
queue q;
49-
50-
#ifdef __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
51-
if (!q.get_device().has(aspect::fp64)) {
52-
std::cout << "Skipping the actual test due to variadic argument promotion. "
53-
"Printing hard-coded output from the host side:\n"
54-
<< "3.140000e+00, 3.140000E+00\n"
55-
"0x1.91eb86p+1, 0X1.91EB86P+1\n"
56-
"3.14, 3.14"
57-
<< std::endl;
58-
return 0;
59-
}
60-
#endif // __SYCL_USE_VARIADIC_SPIRV_OCL_PRINTF__
6146
q.submit([](handler &cgh) {
6247
cgh.single_task<FloatTest>([]() { do_float_test(); });
6348
});

sycl/test/extensions/experimental-printf.cpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

sycl/test/warnings/variadic_ocl_printf.cpp

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)