Skip to content

Commit

Permalink
Enable short_circuit_operators by default
Browse files Browse the repository at this point in the history
  • Loading branch information
strongoier committed Jan 7, 2022
1 parent ec54b89 commit e17f818
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/taichi/lang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def __init__(self):
self.log_level = 'info'
self.gdb_trigger = False
self.experimental_real_function = False
self.short_circuit_operators = False
self.short_circuit_operators = True
self.ndarray_use_torch = False


Expand Down
3 changes: 1 addition & 2 deletions tests/python/test_bit_array_vectorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ def evolve_vectorized(x: ti.template(), y: ti.template()):
num_active_neighbors += ti.cast(x[i + 1, j - 1], ti.u32)
num_active_neighbors += ti.cast(x[i + 1, j], ti.u32)
num_active_neighbors += ti.cast(x[i + 1, j + 1], ti.u32)
y[i, j] = (num_active_neighbors == 3) or (num_active_neighbors == 2
and x[i, j] == 1)
y[i, j] = (num_active_neighbors == 3) | ((num_active_neighbors == 2) & (x[i, j] == 1))

@ti.kernel
def evolve_naive(x: ti.template(), y: ti.template()):
Expand Down

0 comments on commit e17f818

Please sign in to comment.