Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFCI][SYCL] Simplify SYCL_LANGUAGE_VERSION guards #17815

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sycl/include/sycl/detail/defines_elementary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
#endif // __SYCL_DEPRECATED

#ifndef __SYCL2020_DEPRECATED
#if SYCL_LANGUAGE_VERSION == 202012L && \
!defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
#if !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
#define __SYCL2020_DEPRECATED(message) __SYCL_DEPRECATED(message)
#else
#define __SYCL2020_DEPRECATED(message)
Expand Down
13 changes: 4 additions & 9 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,7 @@ class __SYCL_EXPORT handler {
// Range rounding is supported only for newer SYCL standards.
#if !defined(__SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__) && \
!defined(DPCPP_HOST_DEVICE_OPENMP) && \
!defined(DPCPP_HOST_DEVICE_PERF_NATIVE) && \
SYCL_LANGUAGE_VERSION >= 202012L
!defined(DPCPP_HOST_DEVICE_PERF_NATIVE)
auto [RoundedRange, HasRoundedRange] = getRoundedRange(UserRange);
if (HasRoundedRange) {
using NameWT = typename detail::get_kernel_wrapper_name_t<NameT>::name;
Expand Down Expand Up @@ -1224,8 +1223,7 @@ class __SYCL_EXPORT handler {
#endif
} else
#endif // !__SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ &&
// !DPCPP_HOST_DEVICE_OPENMP && !DPCPP_HOST_DEVICE_PERF_NATIVE &&
// SYCL_LANGUAGE_VERSION >= 202012L
// !DPCPP_HOST_DEVICE_OPENMP && !DPCPP_HOST_DEVICE_PERF_NATIVE
{
(void)UserRange;
(void)Props;
Expand Down Expand Up @@ -1838,11 +1836,8 @@ class __SYCL_EXPORT handler {

template <typename T> struct ShouldEnableSetArg {
static constexpr bool value =
std::is_trivially_copyable_v<std::remove_reference_t<T>>
#if SYCL_LANGUAGE_VERSION && SYCL_LANGUAGE_VERSION <= 201707
&& std::is_standard_layout<std::remove_reference_t<T>>::value
#endif
|| is_same_type<sampler, T>::value // Sampler
std::is_trivially_copyable_v<std::remove_reference_t<T>> ||
is_same_type<sampler, T>::value // Sampler
|| (!is_same_type<cl_mem, T>::value &&
std::is_pointer_v<remove_cv_ref_t<T>>) // USM
|| is_same_type<cl_mem, T>::value; // Interop
Expand Down
7 changes: 0 additions & 7 deletions sycl/test/basic_tests/set_arg_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,5 @@ int main() {
5, ntc);
h.set_arg( // expected-error {{no matching member function for call to 'set_arg'}}
4, NonTriviallyCopyable{});
#if SYCL_LANGUAGE_VERSION && SYCL_LANGUAGE_VERSION <= 201707
NonStdLayout nstd;
h.set_arg( // expected-error {{no matching member function for call to 'set_arg'}}
6, nstd);
h.set_arg( // expected-error {{no matching member function for call to 'set_arg'}}
7, NonStdLayout{});
#endif
});
}
Loading