This repository was archived by the owner on May 27, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 103
103
@inline ldexp (x:: Float64 , y:: Int32 ) = @wrap __nv_ldexp (x:: double , y:: i32 ):: double
104
104
@inline ldexp (x:: Float32 , y:: Int32 ) = @wrap __nv_ldexpf (x:: float , y:: i32 ):: float
105
105
106
+ @inline exp (x:: Complex{Float64} ) = exp (x. re) * (cos (x. im) + 1.0im * sin (x. im))
107
+ @inline exp (x:: Complex{Float32} ) = exp (x. re) * (cos (x. im) + 1.0im * sin (x. im))
108
+ @inline exp_fast (x:: Complex{Float32} ) = exp_fast (x. re) * (cos_fast (x. im) + 1.0im * sin_fast (x. im))
106
109
107
110
# # error
108
111
170
173
@inline abs (f:: Float32 ) = @wrap __nv_fabsf (f:: float ):: float
171
174
@inline abs (x:: Int64 ) = @wrap __nv_llabs (x:: i64 ):: i64
172
175
176
+ @inline abs (x:: Complex{Float64} ) = hypot (x. re, x. im)
177
+ @inline abs (x:: Complex{Float32} ) = hypot (x. re, x. im)
173
178
174
179
# # roots and powers
175
180
192
197
@inline pow (x:: Float32 , y:: Int32 ) = @wrap __nv_powif (x:: float , y:: i32 ):: float
193
198
@inline pow (x:: Union{Float32, Float64} , y:: Int64 ) = pow (x, Int32 (y))
194
199
200
+ @inline abs2 (x:: Complex{Float64} ) = x. re * x. re + x. im * x. im
201
+ @inline abs2 (x:: Complex{Float32} ) = x. re * x. re + x. im * x. im
202
+
195
203
# # rounding and selection
196
204
197
205
# TODO : differentiate in return type, map correctly
You can’t perform that action at this time.
0 commit comments