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

Cannot use ti.f64 and ti.random() together. #2045

Closed
JerryYan97 opened this issue Nov 12, 2020 · 2 comments
Closed

Cannot use ti.f64 and ti.random() together. #2045

JerryYan97 opened this issue Nov 12, 2020 · 2 comments
Labels
potential bug Something that looks like a bug but not yet confirmed

Comments

@JerryYan97
Copy link

Hello!

I am trying to use ti.random() when I am using default_fp=ti.64 as init, but it looks like it would report error like this:
python3.8: /home/yuanming/repos/llvm-10.0.0.src/lib/IR/Instructions.cpp:1358: void llvm::StoreInst::AssertOK(): Assertion getOperand(0)->getType() == cast(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
`

Here is the minimum code block to reproduce this problem:
`

Test random number

import taichi as ti
ti.init(arch=ti.gpu, default_fp=ti.f64)

@ti.kernel
def rand_generator():
for i in range(100):
print(ti.random())

rand_generator()
`

@JerryYan97 JerryYan97 added the potential bug Something that looks like a bug but not yet confirmed label Nov 12, 2020
@yuanming-hu
Copy link
Member

Thanks for reporting! I believe this should have been fixed in v0.7.6 - could you have a try? Related: #2023

@yuanming-hu
Copy link
Member

I confirm that this is fixed with v0.7.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
None yet
Development

No branches or pull requests

2 participants