Skip to content

Commit c9dde00

Browse files
[SYCL] Fix std::exp(complex<double>) edge case on Windows (#15489)
This is a follow-up for #15162 There are no new tests added with this PR, because we already have this edge case covered by existing tests here: https://github.com/intel/llvm/blob/3e98b3a09254863423f82d10aa7d40a8b64dbdd3/sycl/test-e2e/DeviceLib/std_complex_math_fp64_test.cpp#L202 But we don't have a Windows machine with a GPU which supports `fp64` and therefoere this edge case went unnoticed by our CI. The change was locally tested in the right environment. Patch-By: Justin Cai <justin.cai@intel.com>
1 parent a496844 commit c9dde00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libdevice/cmath_wrapper_fp64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ short _Exp(double *px, double y,
395395
if (*px < -HUGE_EXP || y == 0.0) // certain underflow
396396
*px = 0.0;
397397
else if (HUGE_EXP < *px) { // certain overflow
398-
*px = _Inf._Double;
398+
*px = _Inf._Double * (y < 0.F ? -1.F : 1.F);
399399
ret = _INFCODE;
400400
} else { // xexp won't overflow
401401
double g = *px * invln2;

0 commit comments

Comments
 (0)