Skip to content

Commit e3f743c

Browse files
author
ZhangAiqiang
committed
[Test] Update a testcase for bool summation
Check the boolean output for tl.sum(i1). When there exist 32*32 True, the output should not be wrongly cast as 0 (False).
1 parent ca37258 commit e3f743c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

python/test/unit/language/test_core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,6 +2588,10 @@ def kernel_default_float(out_ptr):
25882588
kernel_default_int[(1, )](out)
25892589
assert out[0] == 32 * 32
25902590

2591+
out = torch.empty(1, dtype=torch.bool, device=device)
2592+
kernel_default_int[(1, )](out)
2593+
assert out[0] == True
2594+
25912595
out = torch.empty(1, dtype=torch.bfloat16, device=device)
25922596
kernel_default_float[(1, )](out)
25932597
torch.testing.assert_close(out[0], torch.tensor(32 * 32, dtype=torch.bfloat16, device=device))

0 commit comments

Comments
 (0)