Skip to content

Commit

Permalink
fix[next][dace]: use logical and/or/xor operators, not bitwise (#1872)
Browse files Browse the repository at this point in the history
The current mapping from GTIR logical operators to python code was
inconsistent. The mapping was using bitwise operators instead of logical
ones. This still resulted in functionally correct code because the
boolean type has an integer representation in python language. This PR
introduces the correct mapping, and leaves the dace toolchain and target
compiler the possibility to generate optimized code.
  • Loading branch information
edopao authored Feb 18, 2025
1 parent cae8753 commit 0d65ae9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
"less_equal": "({} <= {})",
"greater": "({} > {})",
"greater_equal": "({} >= {})",
"and_": "({} & {})",
"or_": "({} | {})",
"xor_": "({} ^ {})",
"and_": "({} and {})",
"or_": "({} or {})",
"xor_": "({} != {})",
"mod": "({} % {})",
"not_": "(not {})", # ~ is not bitwise in numpy
"not_": "(not {})",
}


Expand Down

0 comments on commit 0d65ae9

Please sign in to comment.