Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 9497d08

Browse files
authored
Merge pull request #516 from PhilipVinc/PhilipVinc-patch-1
fix CuArrays.jl #543 - complex exp type instability
2 parents 2e83fc6 + 25854c3 commit 9497d08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/device/cuda/math.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113
@inline ldexp(x::Float32, y::Int32) = @wrap __nv_ldexpf(x::float, y::i32)::float
114114

115115
@inline exp(x::Complex{Float64}) = exp(x.re) * (cos(x.im) + 1.0im * sin(x.im))
116-
@inline exp(x::Complex{Float32}) = exp(x.re) * (cos(x.im) + 1.0im * sin(x.im))
117-
@inline exp_fast(x::Complex{Float32}) = exp_fast(x.re) * (cos_fast(x.im) + 1.0im * sin_fast(x.im))
116+
@inline exp(x::Complex{Float32}) = exp(x.re) * (cos(x.im) + 1.0f0im * sin(x.im))
117+
@inline exp_fast(x::Complex{Float32}) = exp_fast(x.re) * (cos_fast(x.im) + 1.0f0im * sin_fast(x.im))
118118

119119
## error
120120

0 commit comments

Comments
 (0)