Skip to content

Commit 80667dc

Browse files
committed
2-arg atan
1 parent af2191b commit 80667dc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/device/intrinsics/math.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ using Base.Math: throw_complex_domainerror
5353
@device_override Base.atan(x::Float32) = ccall("extern air.atan.f32", llvmcall, Cfloat, (Cfloat,), x)
5454
@device_override Base.atan(x::Float16) = ccall("extern air.atan.f16", llvmcall, Float16, (Float16,), x)
5555

56+
@device_override FastMath.atan_fast(x::Float32, y::Float32) = ccall("extern air.fast_atan2.f32", llvmcall, Cfloat, (Cfloat, Cfloat), x, y)
57+
@device_override Base.atan(x::Float32, y::Float32) = ccall("extern air.atan2.f32", llvmcall, Cfloat, (Cfloat, Cfloat), x, y)
58+
@device_override Base.atan(x::Float16, y::Float16) = ccall("extern air.atan2.f16", llvmcall, Float16, (Float16, Float16), x, y)
59+
5660
@device_override FastMath.atanh_fast(x::Float32) = ccall("extern air.fast_atanh.f32", llvmcall, Cfloat, (Cfloat,), x)
5761
@device_override Base.atanh(x::Float32) = ccall("extern air.atanh.f32", llvmcall, Cfloat, (Cfloat,), x)
5862
@device_override Base.atanh(x::Float16) = ccall("extern air.atanh.f16", llvmcall, Float16, (Float16,), x)

test/device/intrinsics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ MATH_INTR_FUNCS_2_ARG = [
151151
# step, # T step(T edge, T x) Returns 0.0 if x < edge, otherwise it returns 1.0
152152

153153
# float math
154-
# atan2, # T atan2(T x, T y) Compute arc tangent of y over x.
154+
atan, # T atan2(T x, T y) Compute arc tangent of y over x.
155155
# fdim, # T fdim(T x, T y)
156156
max, # T [f]max(T x, T y)
157157
min, # T [f]min(T x, T y)

0 commit comments

Comments
 (0)