Skip to content

Commit 643d4ff

Browse files
info::device::atomic64 is deprecated (#15740)
1. A separate .def file was created for deprecated features that are not part of SYCL 2020 spec 2. info::device::atomic64 was deprecated 3. Test for info::device::atomic64 deprecated was added into separate file due to -Wno-deprecated-declarations flag in warnings.cpp tests file.
1 parent 75f476d commit 643d4ff

File tree

10 files changed

+42
-24
lines changed

10 files changed

+42
-24
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Marked deprecated in SYCL 2020 spec
2+
__SYCL_PARAM_TRAITS_DEPRECATED(image_support, "deprecated in SYCL 2020, use device::has(aspect::ext_intel_legacy_image) to query for SYCL 1.2.1 image support")
3+
__SYCL_PARAM_TRAITS_DEPRECATED(max_constant_buffer_size,"deprecated in SYCL 2020")
4+
__SYCL_PARAM_TRAITS_DEPRECATED(max_constant_args,"deprecated in SYCL 2020")
5+
__SYCL_PARAM_TRAITS_DEPRECATED(host_unified_memory,"deprecated in SYCL 2020, use device::has() with "
6+
"one of the aspect::usm_* aspects instead")
7+
__SYCL_PARAM_TRAITS_DEPRECATED(is_endian_little,"deprecated in SYCL 2020, check the byte order of "
8+
"the host system instead, the host and the device "
9+
"are required to have the same byte order")
10+
__SYCL_PARAM_TRAITS_DEPRECATED(is_compiler_available,"deprecated in SYCL 2020, use device::has(aspect::online_compiler) instead")
11+
__SYCL_PARAM_TRAITS_DEPRECATED(is_linker_available, "deprecated in SYCL 2020, use device::has(aspect::online_linker) instead")
12+
__SYCL_PARAM_TRAITS_DEPRECATED(queue_profiling, "deprecated in SYCL 2020, use device::has(aspect::queue_profiling) instead")
13+
__SYCL_PARAM_TRAITS_DEPRECATED(built_in_kernels,"deprecated in SYCL 2020, use info::device::built_in_kernel_ids instead")
14+
__SYCL_PARAM_TRAITS_DEPRECATED(profile,"deprecated in SYCL 2020")
15+
__SYCL_PARAM_TRAITS_DEPRECATED(extensions,"deprecated in SYCL 2020, use info::device::aspects instead")
16+
__SYCL_PARAM_TRAITS_DEPRECATED(printf_buffer_size,"deprecated in SYCL 2020")
17+
__SYCL_PARAM_TRAITS_DEPRECATED(preferred_interop_user_sync,"deprecated in SYCL 2020")

sycl/include/sycl/info/device_traits_deprecated.def

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
// Marked deprecated in SYCL 2020 spec
2-
__SYCL_PARAM_TRAITS_DEPRECATED(image_support, "deprecated in SYCL 2020, use device::has(aspect::ext_intel_legacy_image) to query for SYCL 1.2.1 image support")
3-
__SYCL_PARAM_TRAITS_DEPRECATED(max_constant_buffer_size,"deprecated in SYCL 2020")
4-
__SYCL_PARAM_TRAITS_DEPRECATED(max_constant_args,"deprecated in SYCL 2020")
5-
__SYCL_PARAM_TRAITS_DEPRECATED(host_unified_memory,"deprecated in SYCL 2020, use device::has() with "
6-
"one of the aspect::usm_* aspects instead")
7-
__SYCL_PARAM_TRAITS_DEPRECATED(is_endian_little,"deprecated in SYCL 2020, check the byte order of "
8-
"the host system instead, the host and the device "
9-
"are required to have the same byte order")
10-
__SYCL_PARAM_TRAITS_DEPRECATED(is_compiler_available,"deprecated in SYCL 2020, use device::has(aspect::online_compiler) instead")
11-
__SYCL_PARAM_TRAITS_DEPRECATED(is_linker_available, "deprecated in SYCL 2020, use device::has(aspect::online_linker) instead")
12-
__SYCL_PARAM_TRAITS_DEPRECATED(queue_profiling, "deprecated in SYCL 2020, use device::has(aspect::queue_profiling) instead")
13-
__SYCL_PARAM_TRAITS_DEPRECATED(built_in_kernels,"deprecated in SYCL 2020, use info::device::built_in_kernel_ids instead")
14-
__SYCL_PARAM_TRAITS_DEPRECATED(profile,"deprecated in SYCL 2020")
15-
__SYCL_PARAM_TRAITS_DEPRECATED(extensions,"deprecated in SYCL 2020, use info::device::aspects instead")
16-
__SYCL_PARAM_TRAITS_DEPRECATED(printf_buffer_size,"deprecated in SYCL 2020")
17-
__SYCL_PARAM_TRAITS_DEPRECATED(preferred_interop_user_sync,"deprecated in SYCL 2020")
18-
191
// Deprecated and not part of SYCL 2020 spec
202
__SYCL_PARAM_TRAITS_DEPRECATED(image_max_array_size,"support for image arrays has been removed in SYCL 2020")
213
__SYCL_PARAM_TRAITS_DEPRECATED(opencl_c_version,"use device::get_backend_info instead")
4+
__SYCL_PARAM_TRAITS_DEPRECATED(atomic64, "use sycl::aspect::atomic64 instead")
225

236
//TODO:Remove when possible
247
__SYCL_PARAM_TRAITS_DEPRECATED(ext_intel_pci_address,"use ext::intel::info::device::pci_address instead")

sycl/include/sycl/info/info_desc.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ struct atomic_fence_scope_capabilities;
150150

151151
#define __SYCL_PARAM_TRAITS_DEPRECATED(Desc, Message) \
152152
struct __SYCL2020_DEPRECATED(Message) Desc;
153+
#include <sycl/info/device_traits_2020_deprecated.def>
154+
#undef __SYCL_PARAM_TRAITS_DEPRECATED
155+
156+
#define __SYCL_PARAM_TRAITS_DEPRECATED(Desc, Message) \
157+
struct __SYCL_DEPRECATED(Message) Desc;
153158
#include <sycl/info/device_traits_deprecated.def>
154159
#undef __SYCL_PARAM_TRAITS_DEPRECATED
155160

sycl/test-e2e/Basic/windows_version_agnostic_sycl_lib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: windows
22

3-
// RUN: %clangxx --driver-mode=cl /std:c++17 /EHsc -I%sycl_include -I%opencl_include_dir %s -o %t.out /link /defaultlib:%sycl_static_libs_dir/sycl.lib
3+
// RUN: %clangxx --driver-mode=cl /std:c++17 /EHsc /imsvc %sycl_include -I%opencl_include_dir %s -o %t.out /link /defaultlib:%sycl_static_libs_dir/sycl.lib
44
// RUN: %{run} %t.out
55

66
// This test checks that if program is linked with version-agnostic import library sycl.lib then sycl program works as expected.

sycl/test-e2e/Config/kernel_from_file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// RUN: %if linux %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %t_asan.bc %} %else %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %}
1515
// >> ---- translate to SPIR-V
1616
// RUN: llvm-spirv -o %t.spv %t_app.bc
17-
// RUN: %clangxx -Wno-error=ignored-attributes -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -fno-sycl-dead-args-optimization -Xclang -verify-ignore-unexpected=note,warning
17+
// RUN: %clangxx -Wno-error=ignored-attributes -isystem %sycl_include -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -fno-sycl-dead-args-optimization -Xclang -verify-ignore-unexpected=note,warning
1818
// RUN: env SYCL_USE_KERNEL_SPV=%t.spv %{run} %t.out | FileCheck %s
1919
// CHECK: Passed
2020

sycl/test-e2e/DeviceLib/separate_compile_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o %{mathflags}
44
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_test_ihdr.h %S/std_complex_math_test.cpp -Wno-sycl-strict %{mathflags}
55
// >> host compilation...
6-
// RUN: %clangxx -Wno-error=unused-command-line-argument -Wno-error=ignored-attributes %cxx_std_optionc++17 %include_option std_complex_math_test_ihdr.h -c %S/std_complex_math_test.cpp -o %t_host.o %sycl_options -Wno-sycl-strict %{mathflags}
6+
// RUN: %clangxx -Wno-error=unused-command-line-argument -isystem %sycl_include -Wno-error=ignored-attributes %cxx_std_optionc++17 %include_option std_complex_math_test_ihdr.h -c %S/std_complex_math_test.cpp -o %t_host.o %sycl_options -Wno-sycl-strict %{mathflags}
77
// RUN: %clangxx %t_host.o %t_device.o -Wno-unused-command-line-argument -o %t.out %sycl_options %{mathflags}
88
// RUN: %{run} %t.out
99

1010
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o %{mathflags}
1111
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_fp64_test_ihdr.h %S/std_complex_math_fp64_test.cpp -Wno-sycl-strict %{mathflags}
1212
// >> host compilation...
13-
// RUN: %clangxx -Wno-error=unused-command-line-argument -Wno-error=ignored-attributes %cxx_std_optionc++17 %include_option std_complex_math_fp64_test_ihdr.h -c %S/std_complex_math_fp64_test.cpp -o %t_fp64_host.o %sycl_options -Wno-sycl-strict %{mathflags}
13+
// RUN: %clangxx -Wno-error=unused-command-line-argument -isystem %sycl_include -Wno-error=ignored-attributes %cxx_std_optionc++17 %include_option std_complex_math_fp64_test_ihdr.h -c %S/std_complex_math_fp64_test.cpp -o %t_fp64_host.o %sycl_options -Wno-sycl-strict %{mathflags}
1414
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -Wno-unused-command-line-argument -o %t_fp64.out %sycl_options %{mathflags}
1515
// RUN: %{run} %t.out

sycl/test-e2e/SeparateCompile/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// >> device compilation...
99
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -fno-sycl-dead-args-optimization -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_a.h %s -o a_kernel.bc -Wno-sycl-strict
1010
// >> host compilation...
11-
// RUN: %clangxx -Wno-error=ignored-attributes -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option sycl_ihdr_a.h %debug_option -c %s -o a.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
11+
// RUN: %clangxx -Wno-error=ignored-attributes -isystem %sycl_include -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option sycl_ihdr_a.h %debug_option -c %s -o a.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
1212
//
1313
// >> ---- compile src2
1414
// >> device compilation...
1515
// RUN: %clangxx -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 -fno-sycl-dead-args-optimization -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_b.h %s -o b_kernel.bc -Wno-sycl-strict
1616
// >> host compilation...
17-
// RUN: %clangxx -Wno-error=ignored-attributes -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 %cxx_std_optionc++17 %include_option sycl_ihdr_b.h %debug_option -c %s -o b.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
17+
// RUN: %clangxx -Wno-error=ignored-attributes -isystem %sycl_include -Wno-error=unused-command-line-argument -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 %cxx_std_optionc++17 %include_option sycl_ihdr_b.h %debug_option -c %s -o b.o %sycl_options -fno-sycl-dead-args-optimization -Wno-sycl-strict
1818
//
1919
// >> ---- bundle .o with .spv
2020
// >> run bundler

sycl/test/include_deps/sycl_accessor.hpp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
// CHECK-NEXT: ext/oneapi/matrix/matrix-unified-utils.hpp
9797
// CHECK-NEXT: info/platform_traits.def
9898
// CHECK-NEXT: info/context_traits.def
99+
// CHECK-NEXT: info/device_traits_2020_deprecated.def
99100
// CHECK-NEXT: info/device_traits_deprecated.def
100101
// CHECK-NEXT: info/device_traits.def
101102
// CHECK-NEXT: info/queue_traits.def

sycl/test/include_deps/sycl_detail_core.hpp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
// CHECK-NEXT: ext/oneapi/matrix/matrix-unified-utils.hpp
9898
// CHECK-NEXT: info/platform_traits.def
9999
// CHECK-NEXT: info/context_traits.def
100+
// CHECK-NEXT: info/device_traits_2020_deprecated.def
100101
// CHECK-NEXT: info/device_traits_deprecated.def
101102
// CHECK-NEXT: info/device_traits.def
102103
// CHECK-NEXT: info/queue_traits.def
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %clangxx -fsycl -sycl-std=2020 -fsycl-device-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -fsyntax-only -Wall -Wextra
2+
3+
#include <sycl/sycl.hpp>
4+
5+
using namespace sycl;
6+
int main() {
7+
// expected-warning@+1{{'atomic64' is deprecated: use sycl::aspect::atomic64 instead}}
8+
sycl::info::device::atomic64 atomic_64;
9+
(void)atomic_64;
10+
return 0;
11+
}

0 commit comments

Comments
 (0)