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] Fix ret_type and cast_type of UnaryOpStmt in Scalarize #7082

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

strongoier
Copy link
Contributor

@strongoier strongoier commented Jan 6, 2023

Issue: fix #6978

Brief Summary

After #7068, The taichi_ngp example reports RuntimeError: [type_factory.cpp:promoted_type@222] Assertion failure: a->is<TensorType>() && b->is<TensorType>(). The root cause is that taichi_ngp uses atomic_sub on a value with type different from the destination, which will generate neg + cast. However, the ret_type and cast_type of UnaryOpStmt produced by Scalarize aren't set correctly. This PR fixes the problem.

@strongoier strongoier added this to the v1.4.0 milestone Jan 6, 2023
@netlify
Copy link

netlify bot commented Jan 6, 2023

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 84b2843
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/63b7e87bc97f3a0008e66be3
😎 Deploy Preview https://deploy-preview-7082--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@strongoier strongoier requested a review from jim19930609 January 9, 2023 01:39
@strongoier strongoier merged commit b523daf into taichi-dev:master Jan 9, 2023
@strongoier strongoier deleted the r6978 branch January 9, 2023 01:50
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this pull request Jan 9, 2023
…dev#7082)

Issue: fix taichi-dev#6978

### Brief Summary

After taichi-dev#7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
lin-hitonami pushed a commit to lin-hitonami/taichi that referenced this pull request Jan 12, 2023
…dev#7082)

Issue: fix taichi-dev#6978

### Brief Summary

After taichi-dev#7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
…dev#7082)

Issue: fix taichi-dev#6978

### Brief Summary

After taichi-dev#7068, The `taichi_ngp` example reports `RuntimeError:
[type_factory.cpp:promoted_type@222] Assertion failure:
a->is<TensorType>() && b->is<TensorType>()`. The root cause is that
`taichi_ngp` uses `atomic_sub` on a value with type different from the
destination, which will generate `neg` + `cast`. However, the `ret_type`
and `cast_type` of `UnaryOpStmt` produced by `Scalarize` aren't set
correctly. This PR fixes the problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

taichi_ngp example fails on master
2 participants