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 @@ -125,30 +125,10 @@ template <typename T> T logaddexp(T x, T y)
125
125
const T tmp = x - y;
126
126
constexpr T zero (0 );
127
127
128
- if constexpr (std::is_same_v<T, sycl::half>) {
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 ());
133
- }
134
- else {
135
- if constexpr (std::is_same_v<T, double >) {
136
- // FIXME: switch to `sycl::log1p` when
137
- // compiler segfault in CUDA build is fixed
138
- return (tmp > zero)
139
- ? (x + std::log1p (sycl::exp (-tmp)))
140
- : ((tmp <= zero)
141
- ? y + std::log1p (sycl::exp (tmp))
142
- : std::numeric_limits<T>::quiet_NaN ());
143
- }
144
- else {
145
- return (tmp > zero)
146
- ? (x + sycl::log1p (sycl::exp (-tmp)))
147
- : ((tmp <= zero)
148
- ? y + sycl::log1p (sycl::exp (tmp))
149
- : std::numeric_limits<T>::quiet_NaN ());
150
- }
151
- }
128
+ return (tmp > zero)
129
+ ? (x + sycl::log1p (sycl::exp (-tmp)))
130
+ : ((tmp <= zero) ? y + sycl::log1p (sycl::exp (tmp))
131
+ : std::numeric_limits<T>::quiet_NaN ());
152
132
}
153
133
}
154
134
You can’t perform that action at this time.
0 commit comments