Skip to content

Commit

Permalink
Merge branch 'master' of github.com:taichi-dev/taichi into warnings_s…
Browse files Browse the repository at this point in the history
…uppression_pr3
  • Loading branch information
jim19930609 committed May 7, 2022
2 parents 462c129 + 7324903 commit a9b3601
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 3 additions & 2 deletions python/taichi/lang/simt/warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ def match_all():


def active_mask():
# TODO
pass
return expr.Expr(
_ti_core.insert_internal_func_call("cuda_active_mask",
expr.make_expr_group(), False))


def sync(mask):
Expand Down
3 changes: 3 additions & 0 deletions taichi/backends/metal/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ class StreamImpl : public Stream {
auto *cb = static_cast<CommandListImpl *>(cmdlist)->command_buffer();
commit_command_buffer(cb);

// FIXME: Implement semaphore mechanism for Metal backend
// and return the actual semaphore corresponding to the submitted
// cmds.
return nullptr;
}
StreamSemaphore submit_synced(
Expand Down
14 changes: 12 additions & 2 deletions tests/python/test_simt.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,18 @@ def test_match_all():

@test_utils.test(arch=ti.cuda)
def test_active_mask():
# TODO
pass
a = ti.field(dtype=ti.u32, shape=32)

@ti.kernel
def foo():
ti.loop_config(block_dim=16)
for i in range(32):
a[i] = ti.simt.warp.active_mask()

foo()

for i in range(32):
assert a[i] == 65535


@test_utils.test(arch=ti.cuda)
Expand Down

0 comments on commit a9b3601

Please sign in to comment.