diff options
author | Luke Hutton <luke.hutton@arm.com> | 2023-01-12 11:20:37 +0000 |
---|---|---|
committer | Luke Hutton <luke.hutton@arm.com> | 2023-02-27 19:33:20 +0000 |
commit | cbedb765fd7c54c55599bf164c065eb2a2085451 (patch) | |
tree | 7ce42408972ab4158861ad3098a9be7a52a0122c | |
parent | 10fd495c6d3d4034e1a30d2ef65e17a011da58ec (diff) | |
download | tosa_mlir_translator-cbedb765fd7c54c55599bf164c065eb2a2085451.tar.gz |
Support translation of RFFT2d
Signed-off-by: Luke Hutton <luke.hutton@arm.com>
Change-Id: Ic69e006fb9369414f4174e5bb24adadae531775d
-rw-r--r-- | include/operator.def | 3 | ||||
-rw-r--r-- | src/TosaSerialize.cpp | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/operator.def b/include/operator.def index 85bb5c9..51eaf82 100644 --- a/include/operator.def +++ b/include/operator.def @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2021, ARM Limited. +// Copyright (c) 2020-2023, ARM Limited. // // Licensed under the Apache License, Version 2.0 with LLVM Exceptions // (the "License"); you may not use this file except in compliance with @@ -30,6 +30,7 @@ DEF_OPERATOR(DepthwiseConv2D) DEF_OPERATOR(FullyConnected) DEF_OPERATOR(MatMul) DEF_OPERATOR(MaxPool2d) +DEF_OPERATOR(RFFT2d) DEF_OPERATOR(TransposeConv2D) /* activation */ diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp index 4bc67ea..547da8c 100644 --- a/src/TosaSerialize.cpp +++ b/src/TosaSerialize.cpp @@ -1351,6 +1351,22 @@ TosaSerializationOperatorBuilder::build<mlir::tosa::WhileOp>( return tyop; } +template <> +TosaSerializationOperator * +TosaSerializationOperatorBuilder::build<mlir::tosa::RFFT2dOp>( + mlir::Operation &op) const { + std::string input_name = GetTensorName(op.getOperand(0)); + std::string output_real_name = GetTensorName(op.getResult(0)); + std::string output_imag_name = GetTensorName(op.getResult(1)); + + TosaSerializationOperator *tyop = new TosaSerializationOperator( + Op_RFFT2D, Attribute_NONE, nullptr, + std::vector<std::string>{input_name}, + std::vector<std::string>{output_real_name, output_imag_name}); + + return tyop; +} + /* End translating TOSA operator */ mlir::LogicalResult TosaSerializationRegionBuilder::BuildAllBlocksInRegion(std::vector<mlir::Value>& return_values) { std::string region_name = ser_region->GetName(); |