-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] Fix ret_type and cast_type of UnaryOpStmt in Scalarize (#7082)
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.
- Loading branch information
1 parent
734b483
commit b523daf
Showing
2 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters