Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ list(APPEND armnn_sources
src/armnn/Logging.cpp
src/armnn/Network.cpp
src/armnn/Network.hpp
src/armnn/Sme2ShapePolicy.cpp
src/armnn/Sme2ShapePolicy.hpp
src/armnn/NetworkUtils.cpp
src/armnn/NetworkUtils.hpp
src/armnn/Observable.cpp
Expand Down
7 changes: 5 additions & 2 deletions delegate/cmake/Modules/FindTfLite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ if (TfLite_LIB MATCHES .a$)
TfLite_ruy_prepare_packed_matrices_LIB TfLite_ruy_system_aligned_alloc_LIB TfLite_ruy_threadpool_LIB
TfLite_ruy_trmul_LIB TfLite_ruy_tune_LIB TfLite_ruy_wait_LIB TfLite_ruy_profiler_LIB TfLite_cpuinfo_LIB
TfLite_abseil_synchronization_LIB TfLite_abseil_graphCycle_internal_LIB TfLite_abseil_raw_logging_internal_LIB
TfLite_abseil_kernel_timeout_LIB TfLite_abseil_internal_strings_LIB)
TfLite_abseil_internal_strings_LIB)
# Set external variables for usage in CMakeLists.txt
if (TFLITE_FOUND)
# WARNING! The order of these libraries is critical. Moving them
Expand All @@ -166,7 +166,10 @@ if (TfLite_LIB MATCHES .a$)
${TfLite_ruy_prepare_packed_matrices_LIB} ${TfLite_ruy_system_aligned_alloc_LIB}
${TfLite_ruy_tune_LIB} ${TfLite_ruy_wait_LIB} ${TfLite_ruy_profiler_LIB}
${TfLite_cpuinfo_LIB} ${TfLite_abseil_synchronization_LIB} ${TfLite_abseil_graphCycle_internal_LIB}
${TfLite_abseil_raw_logging_internal_LIB} ${TfLite_abseil_kernel_timeout_LIB} ${TfLite_abseil_internal_strings_LIB})
${TfLite_abseil_raw_logging_internal_LIB} ${TfLite_abseil_internal_strings_LIB})
if(TfLite_abseil_kernel_timeout_LIB)
list(APPEND TfLite_LIB ${TfLite_abseil_kernel_timeout_LIB})
endif()
endif ()
elseif (TfLite_LIB MATCHES .so$)
message("-- Dynamic tensorflow lite library found, using for ArmNN build")
Expand Down
2 changes: 1 addition & 1 deletion include/armnnUtils/QuantizeHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ float SelectiveDequantize(T value, float scale, int32_t offset)
template<typename ItType>
struct IsFloatingPointIterator
{
static constexpr bool value=std::is_floating_point<typename std::iterator_traits<ItType>::value_type>::value;
static constexpr bool value=armnn::IsFloatingPoint<typename std::iterator_traits<ItType>::value_type>::value;
};

template <typename T, typename FloatIt,
Expand Down
11 changes: 9 additions & 2 deletions src/armnn/Network.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//
// Copyright © 2017-2025 Arm Ltd and Contributors. All rights reserved.
// Copyright © 2017-2026 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "Network.hpp"
#include "Sme2ShapePolicy.hpp"
#include "Graph.hpp"
#include "Layer.hpp"
#include "DeviceSpec.hpp"
Expand Down Expand Up @@ -2096,6 +2097,12 @@ IOptimizedNetworkPtr Optimize(const Graph& inGraph,
optGraph.InferTensorInfos();
}

if (std::count(backendPreferences.begin(), backendPreferences.end(), armnn::Compute::CpuAcc) > 0)
{
ApplySme2ShapePolicy(optGraph, options.GetReduceFp32ToFp16(), optimizedOptions);
optNetObjPtr->pOptimizedNetworkImpl->GetModelOptions() = optimizedOptions;
}

// Initialize backend settings
BackendSettings backendSettings(backendPreferences, deviceSpec);
auto availablePreferredBackends = backendSettings.GetAvailablePreferredBackends();
Expand Down Expand Up @@ -2207,7 +2214,7 @@ IOptimizedNetworkPtr Optimize(const Graph& inGraph,
OptimizationResult backendOptimizationResult = ApplyBackendOptimizations(optNetObjPtr->pOptimizedNetworkImpl.get(),
backendSettings,
backends,
options.GetModelOptions(),
optimizedOptions,
messages);
if (backendOptimizationResult.m_Error)
{
Expand Down
Loading