Skip to content

Commit 477d53f

Browse files
Drop is_svgenfloat[fh]_v
1 parent 57c3888 commit 477d53f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

sycl/include/sycl/detail/generic_type_traits.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@
2727
namespace sycl {
2828
inline namespace _V1 {
2929
namespace detail {
30-
template <typename T>
31-
inline constexpr bool is_svgenfloatf_v =
32-
is_contained_v<T, gtl::scalar_vector_float_list>;
33-
34-
template <typename T>
35-
inline constexpr bool is_svgenfloath_v =
36-
is_contained_v<T, gtl::scalar_vector_half_list>;
3730

3831
template <typename T>
3932
inline constexpr bool is_genfloat_v = is_contained_v<T, gtl::floating_list>;

sycl/include/sycl/ext/oneapi/experimental/builtins.hpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,13 @@ namespace native {
9595
// sycl::native::tanh is only implemented on nvptx backend so far. For other
9696
// backends we revert to the sycl::tanh impl.
9797
template <typename T>
98-
inline __SYCL_ALWAYS_INLINE std::enable_if_t<
99-
sycl::detail::is_svgenfloatf_v<T> || sycl::detail::is_svgenfloath_v<T>, T>
100-
tanh(T x) __NOEXC {
98+
inline __SYCL_ALWAYS_INLINE
99+
std::enable_if_t<std::is_same_v<T, float> || std::is_same_v<T, half> ||
100+
(detail::is_vec_v<T> &&
101+
(std::is_same_v<detail::element_type_t<T>, float> ||
102+
std::is_same_v<detail::element_type_t<T>, half>)),
103+
T>
104+
tanh(T x) __NOEXC {
101105
#if defined(__NVPTX__)
102106
return sycl::detail::convertFromOpenCLTypeFor<T>(
103107
__clc_native_tanh(sycl::detail::convertToOpenCLType(x)));
@@ -144,7 +148,10 @@ inline __SYCL_ALWAYS_INLINE
144148
// For other backends we revert to the sycl::exp2 impl.
145149
template <typename T>
146150
inline __SYCL_ALWAYS_INLINE
147-
std::enable_if_t<sycl::detail::is_svgenfloath_v<T>, T>
151+
std::enable_if_t<std::is_same_v<T, half> ||
152+
(detail::is_vec_v<T> &&
153+
std::is_same_v<detail::element_type_t<T>, half>),
154+
T>
148155
exp2(T x) __NOEXC {
149156
#if defined(__NVPTX__)
150157
return sycl::detail::convertFromOpenCLTypeFor<T>(

0 commit comments

Comments
 (0)