Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
how to receive multiple return values from a single Halide::Internal::Call #3122
What if the function to call (an intrinsic in our case) returns multiple values? Is this possible for us to say:
let a, b = call F(args)in the IR? If we cannot do that, is there a general way to avoid calling F twice?
To avoid any confusion: I understand it is possible to call a Func to return multiple values, but that is at the language level. What I'm asking is the internal IR.
For things where the value index is not one, a call is really just a load from some realized Func. I.e. it's almost always call_type = Halide. So there's no harm in having multiple calls. It does mean we have no good way to express extern calls that return multiple values.
So the answer is no, there's no general way to avoid calling F twice.