Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to emit invoke on nightly #21

Open
Roger-luo opened this issue Apr 28, 2021 · 1 comment
Open

fail to emit invoke on nightly #21

Roger-luo opened this issue Apr 28, 2021 · 1 comment

Comments

@Roger-luo
Copy link
Member

Roger-luo commented Apr 28, 2021

e.g

using Test
using YaoAPI
using MLStyle
using YaoLocations
using YaoCompiler
using GPUCompiler
using YaoCompiler.Intrinsics
using CompilerPluginTools
using YaoCompiler.Intrinsics: measure

struct DummyReg <: AbstractRegister{1} end

@device function where_is_my_invoke()
    1 => X
end

op = where_is_my_invoke()
interp = YaoInterpreter()
ci, type = code_typed(Intrinsics.apply, (DummyReg, typeof(op)); interp)[1]

on 1.6

julia> ci, type = code_typed(Intrinsics.apply, (DummyReg, typeof(op)); interp)[1]
CodeInfo(
1%1 = invoke YaoCompiler.Intrinsics.apply(_2::DummyReg, $(QuoteNode(XGate))::YaoCompiler.Intrinsics.XGate, $(QuoteNode(Locations(1)))::Locations{Int64})::Const(nothing)
└──      return %1
) => Nothing

on nightly

julia> ci, type = code_typed(Intrinsics.apply, (DummyReg, typeof(op)); interp)[1]
CodeInfo(
1%1 = YaoCompiler.Intrinsics.apply(#register#, $(QuoteNode(XGate)), $(QuoteNode(Locations(1))))::Nothing
└──      return %1
) => Nothing

cc: @vchuravy @femtomc

@vchuravy
Copy link
Collaborator

So this looks like inference deciding that it can't resolve that call to a precise method instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants