Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] llvm ICmpInst assert fail when using if statement with non 32bit int value #8024

Closed
Dinngger opened this issue May 16, 2023 · 1 comment
Assignees

Comments

@Dinngger
Copy link

Describe the bug
llvm ICmpInst assert fail when using if statement with non 32bit value.

To Reproduce

import taichi as ti

ti.init(arch=ti.gpu)

@ti.kernel
def my_test(x: ti.u8): # any non 32bit int type.
    if x:
        print(1)

my_test(1)

Log/Screenshots

$ python3 ti_icmp.py 
[Taichi] version 1.6.0, llvm 15.0.4, commit f1c6fbbd, linux, python 3.8.10
[Taichi] Starting on arch=cuda
python3: /home/dev/.cache/ti-build-cache/llvm15/include/llvm/IR/Instructions.h:1191: void llvm::ICmpInst::AssertOK(): Assertion `getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"' failed.
Aborted (core dumped)

Additional comments
Both cpu and cuda backend raise this error. Vunkan works will with this kernel.

@lin-hitonami
Copy link
Contributor

It seems that this bug is already fixed in the latest master. You can install the nightly build (by pip install -i https://pypi.taichi.graphics/simple/ taichi-nightly) or wait for the next release. If the problem persists even after installing the nightly build, please contact us again.

@github-project-automation github-project-automation bot moved this from Todo to Done in Taichi Lang Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants