We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Minimal reproduction:
import taichi as ti block_dim = 64 N=256 ti.init(arch=ti.cuda, print_ir=True, print_kernel_llvm_ir=True) @ti.kernel def test(out:ti.types.ndarray()): ti.loop_config(block_dim=block_dim) for i in range(N): #gtid = ti.global_thread_idx() tid = i % block_dim val = i * 1.0 sharr = ti.simt.block.SharedArray((block_dim,), ti.f32) sharr[tid] = val ti.simt.block.sync() #ti.atomic_add(sharr[0], val) sharr[0] += sharr[tid] ti.simt.block.sync() out[i] = sharr[tid] arr = ti.ndarray(ti.f32, (N)) test(arr) print(arr.to_numpy())
This gives unexpected numerical results.
The text was updated successfully, but these errors were encountered:
The atomic add is somehow demoted.
Maybe this is due to the fact that some pass treat it as a local variable and then removed the atomic add. Will keep on investigating.
Sorry, something went wrong.
[ir] Except shared array from demote atomics pass. (#7513)
5a90846
Fixes: #7510 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
[ir] Except shared array from demote atomics pass. (taichi-dev#7513)
76f91b7
Fixes: taichi-dev#7510 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
turbo0628
Successfully merging a pull request may close this issue.
Minimal reproduction:
This gives unexpected numerical results.
The text was updated successfully, but these errors were encountered: