Skip to content

Commit

Permalink
add a test for taichi-dev#813
Browse files Browse the repository at this point in the history
  • Loading branch information
xumingkuan committed Apr 20, 2020
1 parent 9a3bb30 commit 2a5f9a0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/python/test_offload_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def ker():


@ti.all_archs
def test_offload_with_cross_block_locals2():
def test_offload_with_cross_block_locals3():
ret = ti.var(ti.f32, shape=())

@ti.kernel
Expand All @@ -61,6 +61,23 @@ def ker():
assert ret[None] == 1


@ti.all_archs
def test_offload_with_cross_block_locals4():
ret = ti.var(ti.f32, shape=())

@ti.kernel
def ker():
a = 1
b = 0
for i in range(10):
b += a
ret[None] = b

ker()

assert ret[None] == 10


@ti.archs_excluding(ti.opengl) # OpenGL doesn't support dynamic range for now
def test_offload_with_flexible_bounds():
s = ti.var(ti.i32, shape=())
Expand Down

0 comments on commit 2a5f9a0

Please sign in to comment.