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

Don't broadcast the cond in the select statement when cond is a scalar #7240

Closed
lin-hitonami opened this issue Jan 28, 2023 · 0 comments
Closed
Assignees
Labels
feature request Suggest an idea on this project

Comments

@lin-hitonami
Copy link
Contributor

Concisely describe the proposed feature
Currently we broadcast the cond in the select statement when cond is a scalar, but LLVM and SPIR-V both support the select statement with a scalar cond, so we don't need to broadcast at all.

@lin-hitonami lin-hitonami added the feature request Suggest an idea on this project label Jan 28, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in Taichi Lang Jan 28, 2023
@lin-hitonami lin-hitonami moved this from Untriaged to Todo in Taichi Lang Feb 3, 2023
@ailzhang ailzhang moved this from Todo to In Progress in Taichi Lang Feb 10, 2023
dream189free added a commit that referenced this issue Feb 15, 2023
Issue: #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>
@github-project-automation github-project-automation bot moved this from In Progress to Done in Taichi Lang Feb 15, 2023
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggest an idea on this project
Projects
Status: Done
Development

No branches or pull requests

3 participants