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

The generation of spirv array type is wrong #7855

Closed
lin-hitonami opened this issue Apr 20, 2023 · 2 comments · Fixed by #7863
Closed

The generation of spirv array type is wrong #7855

lin-hitonami opened this issue Apr 20, 2023 · 2 comments · Fixed by #7863
Assignees

Comments

@lin-hitonami
Copy link
Contributor

Describe the bug

spir_builder_->declare_global(spv::OpTypeArray, vt,
ir_node_2_spv_value[type->element_type()],
type->get_constant_shape()[0]);

We should pass the shape as a spirv value of int immediate number instead of an int literal.

@bobcao3
Copy link
Collaborator

bobcao3 commented Apr 20, 2023

ouch... How did it compile and work on all these GPUs tho

@bobcao3
Copy link
Collaborator

bobcao3 commented Apr 20, 2023

Oh... right we don't declare arrays but rather runtime arrays

@ailzhang ailzhang moved this from Untriaged to Todo in Taichi Lang Apr 21, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Taichi Lang Apr 21, 2023
bobcao3 pushed a commit that referenced this issue Apr 21, 2023
Issue: fixes #7855

### Brief Summary

<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 8f35995</samp>

Fix array size encoding bug in SPIR-V backend. Use
`int_immediate_number` to create SPIR-V constants for array types in
`spirv_types.cpp`.

### Walkthrough

<!--
copilot:walkthrough
-->
### <samp>🤖 Generated by Copilot at 8f35995</samp>

* Fix a bug where array size was not encoded as a SPIR-V constant
([link](https://github.com/taichi-dev/taichi/pull/7863/files?diff=unified&w=0#diff-259a89b8645aab6065eac94864cd4930be7ae91da5cb2e15307ae5fa41015962L456-R459))
* Use `int_immediate_number` to create a constant operand for
`OpTypeArray`
([link](https://github.com/taichi-dev/taichi/pull/7863/files?diff=unified&w=0#diff-259a89b8645aab6065eac94864cd4930be7ae91da5cb2e15307ae5fa41015962L456-R459))
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
Issue: fixes taichi-dev#7855

### Brief Summary

<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 8f35995</samp>

Fix array size encoding bug in SPIR-V backend. Use
`int_immediate_number` to create SPIR-V constants for array types in
`spirv_types.cpp`.

### Walkthrough

<!--
copilot:walkthrough
-->
### <samp>🤖 Generated by Copilot at 8f35995</samp>

* Fix a bug where array size was not encoded as a SPIR-V constant
([link](https://github.com/taichi-dev/taichi/pull/7863/files?diff=unified&w=0#diff-259a89b8645aab6065eac94864cd4930be7ae91da5cb2e15307ae5fa41015962L456-R459))
* Use `int_immediate_number` to create a constant operand for
`OpTypeArray`
([link](https://github.com/taichi-dev/taichi/pull/7863/files?diff=unified&w=0#diff-259a89b8645aab6065eac94864cd4930be7ae91da5cb2e15307ae5fa41015962L456-R459))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants