diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-01 17:09:03 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-02 17:26:39 +0100 |
commit | d0dc770aeb9423081a1ef0245f7449dcf3fb2ee2 (patch) | |
tree | 9943dc9d95200eda938c7996fe4a0f65177a9a4d /src/backends/backendsCommon/IBackendInternal.cpp | |
parent | ae7b832a6f5eda4b28577f57909111135a36dee9 (diff) | |
download | armnn-d0dc770aeb9423081a1ef0245f7449dcf3fb2ee2.tar.gz |
IVGCVSW-3561 Fix the linker issues of the test shared objects in
the Android builds
* Changed the test libs from SHARED to MODULE
* Added IBackendInternal.cpp to separate the default
implementation of OptimizeSubgraphView from the header file
* Linked the modules against armnn to get the missing symbols
* Renamed the test modules to avoid name clashing in the CI system
* Moved the test shared objects to separate folders to keep the
filesystem tidy
Change-Id: I987c56d2d66bdb86f7b391a83c602d0dadf4c674
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Diffstat (limited to 'src/backends/backendsCommon/IBackendInternal.cpp')
-rw-r--r-- | src/backends/backendsCommon/IBackendInternal.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/src/backends/backendsCommon/IBackendInternal.cpp b/src/backends/backendsCommon/IBackendInternal.cpp new file mode 100644 index 0000000000..261613c490 --- /dev/null +++ b/src/backends/backendsCommon/IBackendInternal.cpp @@ -0,0 +1,89 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "IBackendInternal.hpp" + +namespace armnn +{ + +ARMNN_NO_DEPRECATE_WARN_BEGIN +IBackendInternal::ISubGraphConverterPtr IBackendInternal::CreateSubGraphConverter( + const std::shared_ptr<SubGraph>& subGraph) const +{ + return ISubGraphConverterPtr{}; +} + +IBackendInternal::Optimizations IBackendInternal::GetOptimizations() const +{ + return Optimizations{}; +} + +IBackendInternal::SubGraphUniquePtr IBackendInternal::OptimizeSubGraph(const SubGraph& subGraph, + bool& optimizationAttempted) const +{ + optimizationAttempted = false; + return nullptr; +} +ARMNN_NO_DEPRECATE_WARN_END + +IMemoryManagerUniquePtr IBackendInternal::CreateMemoryManager() const +{ + return IMemoryManagerUniquePtr(); +} + +IBackendInternal::IBackendContextPtr IBackendInternal::CreateBackendContext(const IRuntime::CreationOptions&) const +{ + return IBackendContextPtr{}; +} + +// Default implementation of OptimizeSubgraphView for backward compatibility with the old API. +// Override this method with a custom optimization implementation. +OptimizationViews IBackendInternal::OptimizeSubgraphView(const SubgraphView& subgraph) const +{ + bool optimizationAttempted = false; + + ARMNN_NO_DEPRECATE_WARN_BEGIN + SubGraphUniquePtr optSubgraph = OptimizeSubGraph(subgraph, optimizationAttempted); + ARMNN_NO_DEPRECATE_WARN_END + + OptimizationViews result; + if (!optimizationAttempted) + { + result.AddUntouchedSubgraph(SubgraphView(subgraph)); + } + else if (optSubgraph) + { + result.AddSubstitution({subgraph, SubgraphView(*optSubgraph.get())}); + } + else + { + result.AddFailedSubgraph(SubgraphView(subgraph)); + } + + return result; +} + +bool IBackendInternal::SupportsTensorAllocatorAPI() const +{ + return !GetHandleFactoryPreferences().empty(); +} + +ITensorHandleFactory::FactoryId IBackendInternal::GetBackwardCompatibleFavoriteHandleFactory() +{ + auto favorites = GetHandleFactoryPreferences(); + if (favorites.empty()) + { + return ITensorHandleFactory::LegacyFactoryId; + } + + return favorites[0]; +} + +std::vector<ITensorHandleFactory::FactoryId> IBackendInternal::GetHandleFactoryPreferences() const +{ + return std::vector<ITensorHandleFactory::FactoryId>(); +} + +} // namespace armnn |