refactor[cartesian]: avoid extra boolean if we already have a boolean - #2825
refactor[cartesian]: avoid extra boolean if we already have a boolean#2825romanc wants to merge 2 commits into
Conversation
|
Actually, I've been thinking about this in the evening: Since we already split field accesses in I don't know/remember what is meant by "sympy issues down the line" (comment in code), but I think, we should just try and see if anything still breaks. This might have been magically solved by the DaCe v2 update ... |
Sounds good. I have added the second case for the unary operator of a scalar boolean. With this, we at least get the redundant tasklets and booleans out of the way.
Logged in NOAA-GFDL/NDSL#552. |
|
This is ready for review in its final form. CSCS-CI will be out all day due to maintenance. |
|
Cscs-ci run default |
|
cscs-ci run default |
1 similar comment
|
cscs-ci run default |


Description
This is little cleanup in the dace backends regarding conditionals, i.e. what is know in in the
oirasMaskStmt.Mask statements "outsource" the evaluation of conditionals to a separate tasklets to avoid DaCe issues down the line. However, most of the time, the mask is already a boolean scalar (
gtir->oirmakes such that field accesses are split out into a separate assignment (read here if you are interested)).With this PR, we skip the step to make yet another temp boolean in
oir_to_treeirif we detect a plain boolean scalar access (if my_boolean) or a negated boolean scalar (if not my_boolean). In the upstream case ofDelnFlux, this changes the beginning of the generated SDFG as follows (left before, right after)Notice how before we have more tasklets copying one boolean into another where on the left side (after) we only have one tasklet left (which originates from the above
gtir->oirtranslation step).Requirements
Assumed to be covered by the existing test suite.