Cathal Corbett | 9c9d5b9 | 2022-08-17 17:30:16 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2022 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <Layer.hpp> |
| 9 | |
| 10 | #include <tosa_serialization_handler.h> |
| 11 | #include "operatorMappings/AdditionOperator.hpp" |
| 12 | |
| 13 | using namespace armnn; |
| 14 | using namespace tosa; |
| 15 | |
| 16 | // From the input armnn::Layer, set the corresponding data field in the |
| 17 | // tosa::TosaSerializationTensor where constant tensor data exists in the armnn::Layer. |
Matthew Sloyan | 164bf4f | 2022-10-28 18:02:17 +0100 | [diff] [blame^] | 18 | void SetBasicBlockConstantTensorData(Layer* layer, TosaSerializationBasicBlock* /*basicBlock*/); |
Cathal Corbett | 9c9d5b9 | 2022-08-17 17:30:16 +0100 | [diff] [blame] | 19 | |
| 20 | // Populates a tosa::TosaSerializationBasicBlock from constructing |
| 21 | // tosa::TosaSerializationOperator(s) and tosa::TosaSerializationTensor(s) |
| 22 | // based on the input armnn::LayerType and associated armnn::TensorInfos and armnn::Descriptor. |
| 23 | // |
| 24 | // If an armnn::LayerType does not have a tosa mapping or the mapping is not implemented in ArmNN, |
| 25 | // an empty tosa::TosaSerializationBasicBlock() is returned with operator tosa::Op_UNKNOWN. |
| 26 | TosaSerializationBasicBlock* GetTosaMapping(const LayerType type, |
| 27 | const std::vector<const TensorInfo*>& inputs, |
| 28 | const std::vector<const TensorInfo*>& outputs, |
Matthew Sloyan | 164bf4f | 2022-10-28 18:02:17 +0100 | [diff] [blame^] | 29 | const BaseDescriptor& /*descriptor*/); |
Cathal Corbett | 9c9d5b9 | 2022-08-17 17:30:16 +0100 | [diff] [blame] | 30 | |
| 31 | // Function called in armnn::OptimizeSubgraphView() when access to armnn::Layer is available |
| 32 | // and there is an option to set tosa basic block data from constant layer tenors available from the input layer. |
Matthew Sloyan | 164bf4f | 2022-10-28 18:02:17 +0100 | [diff] [blame^] | 33 | TosaSerializationBasicBlock* GetTosaMappingFromLayer(Layer* layer); |