From cbedb765fd7c54c55599bf164c065eb2a2085451 Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Thu, 12 Jan 2023 11:20:37 +0000 Subject: Support translation of RFFT2d Signed-off-by: Luke Hutton Change-Id: Ic69e006fb9369414f4174e5bb24adadae531775d --- include/operator.def | 3 ++- src/TosaSerialize.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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( return tyop; } +template <> +TosaSerializationOperator * +TosaSerializationOperatorBuilder::build( + 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{input_name}, + std::vector{output_real_name, output_imag_name}); + + return tyop; +} + /* End translating TOSA operator */ mlir::LogicalResult TosaSerializationRegionBuilder::BuildAllBlocksInRegion(std::vector& return_values) { std::string region_name = ser_region->GetName(); -- cgit v1.2.1