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

how to receive multiple return values from a single Halide::Internal::Call #3122

Open
ronghongbo opened this Issue Jul 12, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@ronghongbo

ronghongbo commented Jul 12, 2018

In IR.h,

struct Call : public ExprNode<Call> {
   ......
    // If that function has multiple values, which value does this
    // call node refer to?
    int value_index;

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.

Thanks,
Hongbo

@abadams

This comment has been minimized.

Show comment
Hide comment
@abadams

abadams Jul 12, 2018

Member

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.

Member

abadams commented Jul 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment