Skip to content

Conversation

@johnc1231
Copy link
Contributor

Recur needs to emit its args into region 1, then copy them into region 2. Also the emitI result needs to emit into loopRef.r1 before being copied into the main region.

@johnc1231
Copy link
Contributor Author

Trying to cook up a python test that wouldn't pass without this, surprisingly annoying.

@tpoterba
Copy link
Contributor

I think:

return hl.experimental.loop(
    lambda f, array, idx: hl.if_else(idx > 10,  array, f(array.extend(hl.str(idx)), idx + 1),
    hl.tarray(hl.tstr), ['foo'], 1)

@tpoterba
Copy link
Contributor

Could also do a scala test that asserts about memory usage.

@johnc1231
Copy link
Contributor Author

Added the python test, it returns bogus results in main so it's a good one.

@danking danking merged commit 77f889c into hail-is:main Jul 26, 2021
@johnc1231 johnc1231 mentioned this pull request Jul 26, 2021
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

Successfully merging this pull request may close these issues.

3 participants