Skip to content

Commit

Permalink
Use refs instead of pointers to get a slightly friendlier abi (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaraldi authored Sep 30, 2023
1 parent 252a837 commit 1480121
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/device/gcn/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ for jltype in (Float64, Float32, Float16)

@eval @device_override function Base.sincos(x::$jltype)
ref = Ref{$jltype}()
ret = ccall($("extern __ocml_sincos_$(fntypes[jltype])"), llvmcall, $jltype, ($jltype, Ptr{$jltype}), x, ref)
ret = ccall($("extern __ocml_sincos_$(fntypes[jltype])"), llvmcall, $jltype, ($jltype, Ref{$jltype}), x, ref)
return (ret, ref[])
end
@eval @device_override function Base.sincospi(x::$jltype)
ref = Ref{$jltype}()
ret = ccall($("extern __ocml_sincospi_$(fntypes[jltype])"), llvmcall, $jltype, ($jltype, Ptr{$jltype}), x, ref)
ret = ccall($("extern __ocml_sincospi_$(fntypes[jltype])"), llvmcall, $jltype, ($jltype, Ref{$jltype}), x, ref)
return (ret, ref[])
end
end
Expand Down

0 comments on commit 1480121

Please sign in to comment.