Add MatrixTimesMatrix operation to SPIRV Dialect and add NoSideEffect trait to Matrix ops.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | ||
---|---|---|
2960 | By construct a MatrixType's element type is VectorType. so this is gonna succeed so there is no need to wrap it in a if statement. Essentially I think writing something like the following might look nicer: c++ auto leftM = leftMatrix.getNumElements(); auto leftVector = leftMatrix.getElementType().cast<VectorType>(); auto leftN = leftVector.getNumElements(); auto leftElemType = leftVector.getElementType(); // Similarly for rightMatrix and result Matrix What do you think? |
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | ||
---|---|---|
2960 | I agree that this is better. In fact, I had some changes in mind for the matrix type, mainly:
These are minor changes coding wise, but they will make the verification methods much nicer than they are now, and the code easier to follow. And honestly they are intuitive for a matrix type. How that sounds? |
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | ||
---|---|---|
2960 | Sorry for the delay. SGTM! Please go for it! :) |
- add helpers for the matrix type
- update verification methods for matrix operations using the new helpers
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | ||
---|---|---|
2960 | Done, please have a look. |
By construct a MatrixType's element type is VectorType. so this is gonna succeed so there is no need to wrap it in a if statement. Essentially I think writing something like the following might look nicer:
What do you think?