aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorJack Frankland <30410009+FranklandJack@users.noreply.github.com>2023-10-07 01:10:39 +0100
committerGitHub <noreply@github.com>2023-10-06 17:10:39 -0700
commite29a253c9ebaded53a823def985364392c4ba4ec (patch)
tree63e80aa703e11f61d755dc04cbb42419f3476556 /clang/lib/Lex/Preprocessor.cpp
parent78502251f4019953e462bb8bc886381589e9d257 (diff)
downloadllvm-e29a253c9ebaded53a823def985364392c4ba4ec.zip
llvm-e29a253c9ebaded53a823def985364392c4ba4ec.tar.gz
llvm-e29a253c9ebaded53a823def985364392c4ba4ec.tar.bz2
[mlir][tosa][linalg] Apply direct tosa -> linalg Conv2D lowering (#68304)
TOSA defines the filter channel ordering for 2D convolution operation `tosa.conv2d` as `[OC, KH, KW, IC]`. The LinAlg dialect supports `[F, H, W, C]` and `[H, W, C, F]` orderings via the `linalg.conv_2d_nhwc_fhwc` and `linalg.conv_2d_nhwc_hwcf` operations respectively. Where `F == OC`, `KH == H`, `KW == W` and `C == IC`. Currently `tosa.conv2d` is lowered to `linalg.conv2d_nhwc_hwcf` meaning we need to insert a transposition operation to permute the filter channels before they can be passed as weights to the linalg op, that is `[F, H, W, C]` -> `[H, W, C, F]`. An analogous transformation needs to be applied to the quantized operation that lowers to `linalg.conv_2d_nhwc_hwcf_q`. This commit updates the TOSA->LinAlg lowering so that `tosa.conv2d` is lowered to `linalg.conv2d_nhwc_fhwc` removing the need for the introduction of a transposition operation and making the mapping 1-1. It also adds a `linalg.conv_2d_nhwc_fhwc_q` quantized operation to the LinAlg dialect so the same direct 1-1 mapping can be applied to the quantized variant. This commit does not add any new lit tests but repurposes the current TosaToLinalgNamed tests by removing the checks for transpositions and updating the targeted LinAlg operations from `linalg.conv2d_nhwc_hwcf` to linalg.conv2d_nhwc_fhwc`. Signed-off-by: Jack Frankland <jack.frankland@arm.com>
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
0 files changed, 0 insertions, 0 deletions