[Lang] Let kernel argument support matrix nested in a struct #7873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: fixes #7821
A matrix is compiled to a struct with
n * m
elements because the support for matrix arguments is not ready on SPIR-V based backends.Deleted the test testing the error when the arguments exceed 64 because it doesn't have the limit anymore. I will remove the code that raises the error in another PR.
Refactored the argument passing logic of CGraph and C-API as well.
🤖 Generated by Copilot at a2ac2c9
Summary
🧮🛠️🚀
This pull request adds support for matrix and struct arguments in the C++ and C APIs, the AOT graph mode, and the SPIR-V based backends. It does this by introducing new types and functions to represent and handle tensor arguments, modifying the kernel argument processing and launching logic in Python and C++, and updating the code generation and offloading logic for SPIR-V. It also simplifies and fixes some issues with the initialization of the runtime context and the access chain creation for SPIR-V.
Walkthrough
graph_data.cpp
file (link)Value
objects in thespirv_ir_builder.cpp
file (link)