Skip to content

Conversation

Zhyrek
Copy link
Contributor

@Zhyrek Zhyrek commented Nov 30, 2023

Allows functions with "break" and "continue" keywords to be compiled by @jit.rawkernel

Added a test to cupy/tests/cupyx_tests/jit_tests/test_raw.py for both keywords, in both for and while loops.

@emcastillo emcastillo added cat:enhancement Improvements to existing features prio:medium labels Dec 1, 2023
y[:mask] += 1
assert bool((x == y).all())

def test_break_and_continue():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, ill push the change in a few hours when I'm back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are split, also added a non-static break/continue condition to each just in case the compiler can optimize static ones away.

@Zhyrek Zhyrek requested a review from asi1024 December 1, 2023 17:13
Copy link
Member

@asi1024 asi1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM excepts the comment.

@Zhyrek Zhyrek requested a review from asi1024 December 2, 2023 08:18
@asi1024
Copy link
Member

asi1024 commented Dec 2, 2023

/test mini

@Zhyrek
Copy link
Contributor Author

Zhyrek commented Dec 2, 2023

My bad, I still don't have a proper testing env set up yet, so the copied over tests didn't have the "self" parameter. Should work now

@asi1024
Copy link
Member

asi1024 commented Dec 3, 2023

/test mini

@asi1024
Copy link
Member

asi1024 commented Dec 15, 2023

/test mini

@asi1024
Copy link
Member

asi1024 commented Dec 16, 2023

/test mini

@asi1024
Copy link
Member

asi1024 commented Dec 19, 2023

@Zhyrek LGTM! Thanks for your contribution!

@asi1024 asi1024 merged commit 7f55d35 into cupy:main Dec 19, 2023
@asi1024 asi1024 added this to the v14.0.0a1 milestone Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:enhancement Improvements to existing features prio:medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants