You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using JET
mutable struct MutStruct
value::Float64
end
const ms = MutStruct(3.4)
function rc()
period = trunc(Int, ms.value)
@debug "cd" cd = ms.value
end
@report_opt rc()
Shouldn't Julia be able to invoke the concrete trunc version for Float64? invoke(trunc, Tuple{Float64}, ms.value) doesn't report the dispatch, but it's not feasible for me because I need the conversion to Int. . So I tried 'invoke(trunc, Tuple{Type{Int}, Float64}, Int, ms.value)', but it also reports dispatch. Finally I found that unsafe_trunc(Int, ms.value) also avoid the dispatch report. Do you know if there's a better way? thanks
The following alterations to the code also avoid reporting the issue. I thought that it was caused due to the code being inlined, but adding @noinline also avoided the dispatch report.
Hi,
the following code
reports
Shouldn't Julia be able to invoke the concrete trunc version for Float64?
invoke(trunc, Tuple{Float64}, ms.value)
doesn't report the dispatch, but it's not feasible for me because I need the conversion to Int. . So I tried 'invoke(trunc, Tuple{Type{Int}, Float64}, Int, ms.value)', but it also reports dispatch. Finally I found thatunsafe_trunc(Int, ms.value)
also avoid the dispatch report. Do you know if there's a better way? thanksThe following alterations to the code also avoid reporting the issue. I thought that it was caused due to the code being inlined, but adding @noinline also avoided the dispatch report.
@debug "cd" cd = 3.2
thanks
The text was updated successfully, but these errors were encountered: