Skip to content
This repository was archived by the owner on Jun 14, 2025. It is now read-only.

Conversation

@cmikida2
Copy link
Contributor

An effort to fix a previous erroneous attempt at elementwise absolute values (see #20). This new PR features tests that actually check that the absolute values are being properly calculated using this builtin for scalars, arrays, and UserTypes.

Copy link
Owner

@inducer inducer left a comment

Choose a reason for hiding this comment

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

I said I'd left comments during the meeting. Turns out that was only half-true. Typed them in, but not yet submitted them. Sorry!

cb("<state>ytype", "y")
# Test new builtin on a usertype.
cb("z", "<builtin>elementwise_abs(<state>ytype)")
with cb.if_("z[1] > 2"):
Copy link
Owner

Choose a reason for hiding this comment

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

It looks like this is indexing into a user type, which wouldn't be allowed. Can you help me understand? If you'd like to assert something about the internal state of a user type, it should be done in Fortran.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is a fair point. Obviously given the inadequacy of the previous version of the test I wanted to make sure I'm checking the result when the function is applied to scalars, arrays, and usertypes, but without indexing into the UserType (which is just an array) I'm not sure how to check it. Can you explain what you mean by the last part of your comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nvm - I think I did what makes more sense in 0237e4d. (Let me know if this isn't what you meant)

@inducer inducer merged commit 053a4cb into inducer:main Jun 19, 2021
@inducer
Copy link
Owner

inducer commented Jun 19, 2021

LGTM, thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants