-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Different value on a matrix when print is present and absent #6663
Labels
potential bug
Something that looks like a bug but not yet confirmed
Comments
lin-hitonami
added
the
potential bug
Something that looks like a bug but not yet confirmed
label
Nov 18, 2022
Is this related to the dynamic index? @strongoier |
This problem exists on taichi 0.9.2 (the oldest version on the pypi). |
A simpler code snippet: import taichi as ti
ti.init(ti.cpu, dynamic_index=True)
@ti.func
def jacob_eigen_test():
p = ti.Matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]])
loop = 1
sig = ti.Vector([0, 0, 0, 0])
print('p1', p[0, 0])
while loop == 1:
print('p2', p[0, 0])
loop = 0
p[0, 0] = -1
for i in range(1):
sig[i] = 2
return sig, p
@ti.kernel
def test():
Sig, P = jacob_eigen_test()
@ti.kernel
def test2():
Sig, P = jacob_eigen_test()
print(Sig,P)
test()
print('test2')
test2() |
strongoier
added a commit
that referenced
this issue
Dec 7, 2022
Issue: fix #6663 ### Brief Summary In `MatrixPtrStmt`, when `origin` is `GlobalTemporaryStmt`, the semantics of `offset` has changed from the number of bytes to the number of elements. This PR fixes the outdated usage which may overwrite the global tmp buffer. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Repository owner
moved this from Todo
to Done
in Taichi Lang
Dec 7, 2022
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
…v#6820) Issue: fix taichi-dev#6663 ### Brief Summary In `MatrixPtrStmt`, when `origin` is `GlobalTemporaryStmt`, the semantics of `offset` has changed from the number of bytes to the number of elements. This PR fixes the outdated usage which may overwrite the global tmp buffer. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Different value on a matrix when print is present and absent
Originally posted in https://forum.taichi-lang.cn/t/topic/3547/4
To Reproduce
Log/Screenshots
Additional comments
The IR of test:
The IR of test2:
The text was updated successfully, but these errors were encountered: