Skip to content

Commit 0ea77ca

Browse files
authored
Merge pull request #259 from JuliaGPU/jps/fix-signbit-return
math: Make signbit return Bool
2 parents 8d0ba06 + 3f45655 commit 0ea77ca

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/device/gcn/math.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ for jltype in (Float32, Float64)
6363
push!(MATH_INTRINSICS, GCNIntrinsic(:isfinite; inp_args=(jltype,), out_arg=Int32, tobool=true))
6464
push!(MATH_INTRINSICS, GCNIntrinsic(:isinf; inp_args=(jltype,), out_arg=Int32, tobool=true))
6565
push!(MATH_INTRINSICS, GCNIntrinsic(:isnan; inp_args=(jltype,), out_arg=Int32, tobool=true))
66-
push!(MATH_INTRINSICS, GCNIntrinsic(:signbit; inp_args=(jltype,), out_arg=Int32))
66+
push!(MATH_INTRINSICS, GCNIntrinsic(:signbit; inp_args=(jltype,), out_arg=Int32, tobool=true))
6767
end
6868

6969
for intr in MATH_INTRINSICS

test/device/math.jl

+4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ using Base.FastMath
1616
isdefined(SpecialFunctions, jlintr) ? SpecialFunctions :
1717
nothing)
1818
modname !== nothing || continue
19+
1920
# FIXME: Handle all input and output args
2021
T = intr.inp_args[1]
2122
intr_kern = Symbol("intr_$(jlintr)_$T")
23+
2224
@eval begin
2325
function $intr_kern(out, a)
2426
i = Device.workitemIdx().x
@@ -38,6 +40,8 @@ using Base.FastMath
3840
end
3941
len = prod(dims)
4042

43+
@test only(Base.return_types($modname.$jlintr, (eltype(d_a),))) === eltype(d_out)
44+
4145
wait(@roc groupsize=len $intr_kern(d_out, d_a))
4246
out = Array(d_out)
4347
@test $modname.$jlintr.(a) out

0 commit comments

Comments
 (0)