File tree Expand file tree Collapse file tree 1 file changed +4
-24
lines changed
dpctl/tensor/libtensor/include/utils Expand file tree Collapse file tree 1 file changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -126,30 +126,10 @@ template <typename T> T logaddexp(T x, T y)
126
126
const T tmp = x - y;
127
127
constexpr T zero (0 );
128
128
129
- if constexpr (std::is_same_v<T, sycl::half>) {
130
- return (tmp > zero)
131
- ? (x + sycl::log1p (sycl::exp (-tmp)))
132
- : ((tmp <= zero) ? y + sycl::log1p (sycl::exp (tmp))
133
- : std::numeric_limits<T>::quiet_NaN ());
134
- }
135
- else {
136
- if constexpr (std::is_same_v<T, double >) {
137
- // FIXME: switch to `sycl::log1p` when
138
- // compiler segfault in CUDA build is fixed
139
- return (tmp > zero)
140
- ? (x + std::log1p (sycl::exp (-tmp)))
141
- : ((tmp <= zero)
142
- ? y + std::log1p (sycl::exp (tmp))
143
- : std::numeric_limits<T>::quiet_NaN ());
144
- }
145
- else {
146
- return (tmp > zero)
147
- ? (x + sycl::log1p (sycl::exp (-tmp)))
148
- : ((tmp <= zero)
149
- ? y + sycl::log1p (sycl::exp (tmp))
150
- : std::numeric_limits<T>::quiet_NaN ());
151
- }
152
- }
129
+ return (tmp > zero)
130
+ ? (x + sycl::log1p (sycl::exp (-tmp)))
131
+ : ((tmp <= zero) ? y + sycl::log1p (sycl::exp (tmp))
132
+ : std::numeric_limits<T>::quiet_NaN ());
153
133
}
154
134
}
155
135
You can’t perform that action at this time.
0 commit comments