Skip to content

[SYCL] Remove sycl::abs FP overload #13286

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

Merged
merged 1 commit into from
Apr 4, 2024
Merged
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
6 changes: 0 additions & 6 deletions sycl/include/sycl/detail/builtins/math_functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,5 @@ template <typename T> detail::builtin_enable_nan_t<T> nan(T x) {
}
#endif

template <typename T>
__SYCL_DEPRECATED("abs for floating point types is non-standard and has been "
"deprecated. Please use fabs instead.")
detail::builtin_enable_math_allow_scalar_t<T> abs(T x) {
return fabs(x);
}
} // namespace _V1
} // namespace sycl
5 changes: 4 additions & 1 deletion sycl/test-e2e/Basic/sycl_2020_images/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ template <typename T, int Dims> bool AllTrue(const vec<T, Dims> &Vec) {
template <typename T, int Dims>
bool ApproxEq(const vec<T, Dims> &LHS, const vec<T, Dims> &RHS,
T Precision = 0.1) {
return AllTrue(sycl::abs(LHS - RHS) <= Precision);
if constexpr (std::is_integral_v<T>)
return AllTrue(sycl::abs(LHS - RHS) <= Precision);
else
return AllTrue(sycl::fabs(LHS - RHS) <= Precision);
}

template <typename T, int Dims>
Expand Down
3 changes: 0 additions & 3 deletions sycl/test/warnings/sycl_2020_deprecations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ int main() {
sycl::byte B;
(void)B;

// expected-warning@+1{{abs for floating point types is non-standard and has been deprecated. Please use fabs instead.}}
sycl::abs(0.0f);

// expected-warning@+1{{'image_support' is deprecated: deprecated in SYCL 2020, use device::has(aspect::ext_intel_legacy_image) to query for SYCL 1.2.1 image support}}
using IS = sycl::info::device::image_support;
// expected-warning@+1{{'max_constant_buffer_size' is deprecated: deprecated in SYCL 2020}}
Expand Down