From 148012189ba6acb1cb3d13fcd715e244d429dd78 Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Sat, 30 Sep 2023 07:09:13 -0300 Subject: [PATCH] Use refs instead of pointers to get a slightly friendlier abi (#504) --- src/device/gcn/math.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device/gcn/math.jl b/src/device/gcn/math.jl index 0563b9ffb..e95e26116 100644 --- a/src/device/gcn/math.jl +++ b/src/device/gcn/math.jl @@ -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