blob: 4b5066ee4552995270ef224c846a3d7d20397952 [file] [log] [blame]
telsoa015307bc12018-03-09 13:51:08 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5
6#pragma once
7
8#include "HalInterfaces.h"
9#include "NeuralNetworks.h"
10#include <armnn/ArmNN.hpp>
11#include <CpuExecutor.h>
12
surmeh01deb3bdb2018-07-05 12:06:04 +010013#include "ArmnnDriver.hpp"
14
telsoa015307bc12018-03-09 13:51:08 +000015#include <vector>
16#include <string>
17
18namespace armnn_driver
19{
20
21extern const armnn::PermutationVector g_DontPermute;
22
23class UnsupportedOperand: public std::runtime_error
24{
25public:
26 UnsupportedOperand(const OperandType type)
27 : std::runtime_error("Operand type is unsupported")
28 , m_type(type)
29 {}
30
31 OperandType m_type;
32};
33
34/// Swizzles tensor data in @a input according to the dimension mappings.
35void SwizzleAndroidNn4dTensorToArmNn(const armnn::TensorInfo& tensor, const void* input, void* output,
36 const armnn::PermutationVector& mappings);
37
38/// Returns a pointer to a specific location in a pool
39void* GetMemoryFromPool(DataLocation location,
40 const std::vector<android::nn::RunTimePoolInfo>& memPools);
41
42/// Can throw UnsupportedOperand
43armnn::TensorInfo GetTensorInfoForOperand(const Operand& operand);
44
45std::string GetOperandSummary(const Operand& operand);
surmeh01deb3bdb2018-07-05 12:06:04 +010046std::string GetModelSummary(const V1_0::Model& model);
telsoa015307bc12018-03-09 13:51:08 +000047
48void DumpTensor(const std::string& dumpDir,
49 const std::string& requestName,
50 const std::string& tensorName,
51 const armnn::ConstTensor& tensor);
52
surmeh0176660052018-03-29 16:33:54 +010053void ExportNetworkGraphToDotFile(const armnn::IOptimizedNetwork& optimizedNetwork,
54 const std::string& dumpDir,
surmeh01deb3bdb2018-07-05 12:06:04 +010055 const V1_0::Model& model);
telsoa015307bc12018-03-09 13:51:08 +000056}