Esempio n. 1
0
    def atomic_and(self, other):
        """Return the new expression of computing atomic and between self and a given operand.

        Args:
            other (Any): Given operand.

        Returns:
            :class:`~taichi.lang.expr.Expr`: The computing expression of atomic and."""
        _taichi_skip_traceback = 1
        return ti.atomic_and(self, other)
Esempio n. 2
0
def in_grid(c):
    res = 1
    for i in ti.static(range(dim)):
        res = ti.atomic_and(res, (0 <= c[i] < grid_size[i]))
    return res
Esempio n. 3
0
 def atomic_and(self, other):
     import taichi as ti
     return ti.atomic_and(self, other)
 def func():
     a = 1023
     for i in range(10):
         ti.atomic_and(a, max_int - 2**i)
     A[None] = a
Esempio n. 5
0
 def func():
     c[None] = 1023
     for i in range(10):
         # this is an expr with side effect, make sure it's not optimized out.
         ti.atomic_and(c[None], max_int - 2**i)
Esempio n. 6
0
 def is_in_grid(self, c):
     res = 1
     for i in ti.static(range(self.dim)):
         res = ti.atomic_and(res, (0 <= c[i] < self.grid_pos[i]))
     return res
Esempio n. 7
0
 def atomic_and(self, other):
     import taichi as ti
     _taichi_skip_traceback = 1
     return ti.atomic_and(self, other)
Esempio n. 8
0
 def atomic_and(self, other):
     _taichi_skip_traceback = 1
     return ti.atomic_and(self, other)