-
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
[lang] Stop broadcasting scalar cond in select statements #7344
[lang] Stop broadcasting scalar cond in select statements #7344
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
for more information, see https://pre-commit.ci
cond
in select
statementsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Btw you can add a C++ test to:
- create a TernaryOpExpression at Frontend IR level
- make a function call to TernaryOpExpression::type_check(...)
- Verify that the
cond
wasn't broadcast-ed anymore
you can refer to: tests/cpp/ir/frontend_type_inference_test.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm, looks like it's poluted by some other branches?
…#7344) Issue: taichi-dev#7240 ### Brief Summary 1. Stop broadcasting `cond` when it is a scalar in a `select` statement. 2. Since `config.real_matrix_scalarize` is currently set to `True`, we need to scalarize the `select`. I added another code path to do this, which seems ugly. 3. We can see the expected behavior when `config.real_matrix_scalarize` is unset. 4. Add python and c++ unit test for select stmts. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue: #7240
Brief Summary
cond
when it is a scalar in aselect
statement.config.real_matrix_scalarize
is currently set toTrue
, we need to scalarize theselect
. I added another code path to do this, which seems ugly.config.real_matrix_scalarize
is unset.