Includes tests and implementation for both integer and floating point values.
Both nearest neighbor and bilinear interpolation is included.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM. The code looks reasonable, assuming you verified the outputs are correct on a few cases (always tricky to statically inspect the code).
please wait for @sjarus who is more familiar with the spec of this op for a second look, due to the complexity
This seems to look fine functionally, modulo the inline aesthetic comments.
Tip: in case you also want to see an implementation of TOSA ops that looks C-like, please take a look at the reference model source: https://git.mlplatform.org/tosa/reference_model.git , e.g. src/ops/image.cc in this case.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
1278–1283 | This block is mode invariant . | |
1318–1326 | I know these are equivalent to the xPred/yPred approach in Nearest Neighbor mode, but does it make sense to make this common code ? In case additional modes are defined that leverage the same logic, it would avoid further duplication of the same intent. |
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
1318–1326 | There are a few tweaks I could do but with the clamp helper its about as minimal overlap as we are going to get (especially because nearest needs to do its wrapping separately). Overall I expect if more sampling methods are introduced we will likely produce different converters for each configuration. |
This block is mode invariant .