Example #1
0
 def check_stride():
     for i in range(128):
         assert ti.get_addr(y, i) - ti.get_addr(x,
                                                i) == v.dynamic_index_stride
         assert ti.get_addr(z, i) - ti.get_addr(y,
                                                i) == v.dynamic_index_stride
Example #2
0
def fill():
    for i, j in a:
        base = ti.get_addr(a.snode(), [0, 0])
        a[i, j] = int(ti.get_addr(a.snode(), [i, j]) - base) // 4
Example #3
0
 def get_field_addr(i: ti.i32, j: ti.i32) -> ti.u64:
     return ti.get_addr(b, [i, j])