Skip to content

Commit e5af883

Browse files
authored
[SYCL] Return support for compilation with C++14 back (intel#3802)
1 parent c53d481 commit e5af883

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

sycl/include/CL/sycl/detail/defines_elementary.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@
4040

4141
#ifndef __SYCL_DEPRECATED
4242
#ifndef SYCL_DISABLE_DEPRECATION_WARNINGS
43-
#ifdef _WIN32
44-
#define __SYCL_DEPRECATED(message) __declspec(deprecated(message))
45-
#else
46-
#define __SYCL_DEPRECATED(message) __attribute__((deprecated(message)))
47-
#endif
43+
#define __SYCL_DEPRECATED(message) [[deprecated(message)]]
4844
#else // SYCL_DISABLE_DEPRECATION_WARNINGS
4945
#define __SYCL_DEPRECATED(message)
5046
#endif // SYCL_DISABLE_DEPRECATION_WARNINGS

sycl/include/CL/sycl/kernel.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ class __SYCL_EXPORT kernel {
153153
/// \return depends on information being queried.
154154
template <info::kernel_sub_group param>
155155
// clang-format off
156-
typename info::param_traits<info::kernel_sub_group, param>::return_type
157156
__SYCL_DEPRECATED("Use get_info with info::kernel_device_specific instead.")
157+
typename info::param_traits<info::kernel_sub_group, param>::return_type
158158
get_sub_group_info(const device &Device) const;
159159
// clang-format on
160160

@@ -166,8 +166,8 @@ class __SYCL_EXPORT kernel {
166166
/// \return depends on information being queried.
167167
template <info::kernel_sub_group param>
168168
// clang-format off
169-
typename info::param_traits<info::kernel_sub_group, param>::return_type
170169
__SYCL_DEPRECATED("Use get_info with info::kernel_device_specific instead.")
170+
typename info::param_traits<info::kernel_sub_group, param>::return_type
171171
get_sub_group_info(const device &Device,
172172
typename info::param_traits<info::kernel_sub_group,
173173
param>::input_type Value) const;

sycl/include/CL/sycl/kernel_handler.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class kernel_handler {
4343
}
4444

4545
#ifdef __SYCL_DEVICE_ONLY__
46+
#if __cplusplus >= 201703L
4647
template <
4748
auto &S,
4849
typename T = typename std::remove_reference_t<decltype(S)>::value_type,
@@ -63,6 +64,7 @@ class kernel_handler {
6364
return __sycl_getComposite2020SpecConstantValue<T>(
6465
SymbolicID, &S, MSpecializationConstantsBuffer);
6566
}
67+
#endif // __cplusplus >= 201703L
6668
#endif // __SYCL_DEVICE_ONLY__
6769

6870
char *MSpecializationConstantsBuffer = nullptr;

sycl/include/CL/sycl/properties/accessor_properties.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class __SYCL2020_DEPRECATED("spelling is now: no_init") noinit
2828

2929
__SYCL_INLINE_CONSTEXPR property::no_init no_init;
3030

31-
__SYCL_INLINE_CONSTEXPR property::noinit
32-
__SYCL2020_DEPRECATED("spelling is now: no_init") noinit;
31+
__SYCL2020_DEPRECATED("spelling is now: no_init")
32+
__SYCL_INLINE_CONSTEXPR property::noinit noinit;
3333

3434
#else
3535

sycl/include/CL/sycl/sycl_span.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//
88
//===---------------------------------------------------------------------===//
99

10+
#if __cplusplus >= 201703L
11+
1012
#ifndef _SYCL_SPAN
1113
#define _SYCL_SPAN
1214

@@ -623,3 +625,5 @@ span(const _Container &)->span<const typename _Container::value_type>;
623625
} // __SYCL_INLINE_NAMESPACE(cl)
624626

625627
#endif // _SYCL_SPAN
628+
629+
#endif // __cplusplus >= 201703L

sycl/test/basic_tests/stdcpp_compat.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out
2+
// RUN: %clangxx -fsycl -std=c++14 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out
23
// RUN: %clangxx -fsycl -std=c++17 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out
34
// RUN: %clangxx -fsycl -std=c++20 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out
45
// expected-no-diagnostics

sycl/unittests/get_native_interop/test_get_native.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//
99
//===----------------------------------------------------------------------===//
1010

11+
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
12+
1113
#include <CL/sycl.hpp>
1214
#include <CL/sycl/backend/opencl.hpp>
1315
#include <detail/context_impl.hpp>

0 commit comments

Comments
 (0)