Skip to content

Commit 415dcbd

Browse files
[NFCI][SYCL] Simplify SYCL_LANGUAGE_VERSION guards
SYCL 1.2 support has been removed quite some time ago, FE only reports `202012L` https://github.com/intel/llvm/blob/9e38e3a05f42b32819a4a570973b925df97e174b/clang/lib/Basic/Version.cpp#L129-L133 so we can expect it's at least that.
1 parent 1d0e1eb commit 415dcbd

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

sycl/include/sycl/detail/defines_elementary.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@
5757
#endif // __SYCL_DEPRECATED
5858

5959
#ifndef __SYCL2020_DEPRECATED
60-
#if SYCL_LANGUAGE_VERSION == 202012L && \
61-
!defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
60+
#if !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
6261
#define __SYCL2020_DEPRECATED(message) __SYCL_DEPRECATED(message)
6362
#else
6463
#define __SYCL2020_DEPRECATED(message)

sycl/include/sycl/handler.hpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,8 +1194,7 @@ class __SYCL_EXPORT handler {
11941194
// Range rounding is supported only for newer SYCL standards.
11951195
#if !defined(__SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__) && \
11961196
!defined(DPCPP_HOST_DEVICE_OPENMP) && \
1197-
!defined(DPCPP_HOST_DEVICE_PERF_NATIVE) && \
1198-
SYCL_LANGUAGE_VERSION >= 202012L
1197+
!defined(DPCPP_HOST_DEVICE_PERF_NATIVE)
11991198
auto [RoundedRange, HasRoundedRange] = getRoundedRange(UserRange);
12001199
if (HasRoundedRange) {
12011200
using NameWT = typename detail::get_kernel_wrapper_name_t<NameT>::name;
@@ -1224,8 +1223,7 @@ class __SYCL_EXPORT handler {
12241223
#endif
12251224
} else
12261225
#endif // !__SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ &&
1227-
// !DPCPP_HOST_DEVICE_OPENMP && !DPCPP_HOST_DEVICE_PERF_NATIVE &&
1228-
// SYCL_LANGUAGE_VERSION >= 202012L
1226+
// !DPCPP_HOST_DEVICE_OPENMP && !DPCPP_HOST_DEVICE_PERF_NATIVE
12291227
{
12301228
(void)UserRange;
12311229
(void)Props;
@@ -1838,11 +1836,8 @@ class __SYCL_EXPORT handler {
18381836

18391837
template <typename T> struct ShouldEnableSetArg {
18401838
static constexpr bool value =
1841-
std::is_trivially_copyable_v<std::remove_reference_t<T>>
1842-
#if SYCL_LANGUAGE_VERSION && SYCL_LANGUAGE_VERSION <= 201707
1843-
&& std::is_standard_layout<std::remove_reference_t<T>>::value
1844-
#endif
1845-
|| is_same_type<sampler, T>::value // Sampler
1839+
std::is_trivially_copyable_v<std::remove_reference_t<T>> ||
1840+
is_same_type<sampler, T>::value // Sampler
18461841
|| (!is_same_type<cl_mem, T>::value &&
18471842
std::is_pointer_v<remove_cv_ref_t<T>>) // USM
18481843
|| is_same_type<cl_mem, T>::value; // Interop

sycl/test/basic_tests/set_arg_error.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,5 @@ int main() {
5050
5, ntc);
5151
h.set_arg( // expected-error {{no matching member function for call to 'set_arg'}}
5252
4, NonTriviallyCopyable{});
53-
#if SYCL_LANGUAGE_VERSION && SYCL_LANGUAGE_VERSION <= 201707
54-
NonStdLayout nstd;
55-
h.set_arg( // expected-error {{no matching member function for call to 'set_arg'}}
56-
6, nstd);
57-
h.set_arg( // expected-error {{no matching member function for call to 'set_arg'}}
58-
7, NonStdLayout{});
59-
#endif
6053
});
6154
}

0 commit comments

Comments
 (0)