aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Hughes <robert.hughes@arm.com>2021-07-14 09:31:31 +0100
committerRob Hughes <robert.hughes@arm.com>2021-07-15 14:50:36 +0100
commitc013bc85f45add8c4bc8c7163316bbb90b37a15e (patch)
tree8a583a4bceb2eb772229dae2c2587bd6347a59ea
parent1ccb3c3a26d8b02959493a54367054c1b43ab12c (diff)
downloadarmnn-c013bc85f45add8c4bc8c7163316bbb90b37a15e.tar.gz
Fix some compile warnings & errors
* Fix type of literals * Add explicit casts * #include missing headers * Replace use of non-standard u_int8_t * Remove name of unused variables * Fix DLL export macro - this was broken when some of the exporting headers were moved to a different library. Change-Id: Ie569c8df41a077b46c608798f39526352e2aeb3a Signed-off-by: Rob Hughes <robert.hughes@arm.com>
-rw-r--r--profiling/common/src/CMakeLists.txt2
-rw-r--r--src/armnn/Threadpool.cpp2
-rw-r--r--src/armnn/test/EndToEndTest.cpp2
-rw-r--r--src/armnn/test/FlowControl.cpp2
-rw-r--r--src/armnn/test/RuntimeTests.cpp2
-rw-r--r--src/armnnTfLiteParser/test/L2Normalization.cpp1
-rw-r--r--src/backends/backendsCommon/test/OptimizedNetworkTests.cpp4
-rw-r--r--src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp2
-rw-r--r--src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp2
-rw-r--r--src/backends/reference/workloads/BaseIterator.hpp2
-rw-r--r--src/backends/reference/workloads/Reduce.cpp2
11 files changed, 14 insertions, 9 deletions
diff --git a/profiling/common/src/CMakeLists.txt b/profiling/common/src/CMakeLists.txt
index 6979275c49..b4dc59f53d 100644
--- a/profiling/common/src/CMakeLists.txt
+++ b/profiling/common/src/CMakeLists.txt
@@ -28,6 +28,8 @@ if(BUILD_TIMELINE_DECODER)
# to simplify the build. No extra .so file to deploy to boards etc.
add_library_ex(pipeCommon STATIC ${pipeCommon_sources})
+ target_compile_definitions(pipeCommon PRIVATE "ARMNN_COMPILING_DLL")
+
# install the target
install(
TARGETS pipeCommon
diff --git a/src/armnn/Threadpool.cpp b/src/armnn/Threadpool.cpp
index a23c1e2339..4289a4b1b7 100644
--- a/src/armnn/Threadpool.cpp
+++ b/src/armnn/Threadpool.cpp
@@ -194,7 +194,7 @@ void Threadpool::ProcessExecPriorities(uint32_t index)
cb->Notify(Status::Success, std::make_pair(startTime, armnn::GetTimeNow())) :
cb->Notify(Status::Failure, std::make_pair(startTime, armnn::GetTimeNow()));
}
- catch (const RuntimeException &error)
+ catch (const RuntimeException&)
{
cb->Notify(Status::Failure, std::make_pair(startTime, armnn::GetTimeNow()));
}
diff --git a/src/armnn/test/EndToEndTest.cpp b/src/armnn/test/EndToEndTest.cpp
index 705258e07f..8a64a4b75f 100644
--- a/src/armnn/test/EndToEndTest.cpp
+++ b/src/armnn/test/EndToEndTest.cpp
@@ -49,7 +49,7 @@ TEST_CASE("ErrorOnLoadNetwork")
Optimize(*net, backends, runtime->GetDeviceSpec(), OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const InvalidArgumentException& e)
+ catch (const InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/armnn/test/FlowControl.cpp b/src/armnn/test/FlowControl.cpp
index de53060c2f..cb56873663 100644
--- a/src/armnn/test/FlowControl.cpp
+++ b/src/armnn/test/FlowControl.cpp
@@ -58,7 +58,7 @@ TEST_CASE("ErrorOnLoadNetwork")
Optimize(*net, backends, runtime->GetDeviceSpec(), OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const InvalidArgumentException& e)
+ catch (const InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/armnn/test/RuntimeTests.cpp b/src/armnn/test/RuntimeTests.cpp
index 8fa5e3e2f4..4652d1c8cf 100644
--- a/src/armnn/test/RuntimeTests.cpp
+++ b/src/armnn/test/RuntimeTests.cpp
@@ -270,7 +270,7 @@ TEST_CASE("IVGCVSW_1929_QuantizedSoftmaxIssue")
errMessages);
FAIL("An exception should have been thrown");
}
- catch (const InvalidArgumentException& e)
+ catch (const InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/armnnTfLiteParser/test/L2Normalization.cpp b/src/armnnTfLiteParser/test/L2Normalization.cpp
index f4eeaac051..76bb9456a9 100644
--- a/src/armnnTfLiteParser/test/L2Normalization.cpp
+++ b/src/armnnTfLiteParser/test/L2Normalization.cpp
@@ -8,6 +8,7 @@
#include <string>
#include <iostream>
+#include <numeric>
TEST_SUITE("TensorflowLiteParser_L2Normalization")
{
diff --git a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
index dcea9ef72e..012737e1d7 100644
--- a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
+++ b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
@@ -96,7 +96,7 @@ TEST_CASE("OptimizeValidateDeviceNonSupportLayerNoFallback")
Optimize(*net, backends, runtime->GetDeviceSpec(), armnn::OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const armnn::InvalidArgumentException& e)
+ catch (const armnn::InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
@@ -216,7 +216,7 @@ TEST_CASE("OptimizeValidateWorkloadsUndefinedComputeDevice")
Optimize(*net, backends, runtime->GetDeviceSpec(), armnn::OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const armnn::InvalidArgumentException& e)
+ catch (const armnn::InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp
index aec57dbad1..92bce4f460 100644
--- a/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp
@@ -113,7 +113,7 @@ LayerTestResult<float, 4> CastUInt8ToFloat2dTest(armnn::IWorkloadFactory& worklo
const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
const armnn::ITensorHandleFactory& tensorHandleFactory)
{
- std::vector<u_int8_t> inputValues = { 1, 3, 1, 3, 1, 3, 1, 3, 1,
+ std::vector<uint8_t> inputValues = { 1, 3, 1, 3, 1, 3, 1, 3, 1,
3, 1, 3, 1, 2, 1, 3, 1, 3 };
std::vector<float> outputValues = { 1.0f, 3.0f, 1.0f, 3.0f, 1.0f, 3.0f, 1.0f, 3.0f, 1.0f,
3.0f, 1.0f, 3.0f, 1.0f, 2.0f, 1.0f, 3.0f, 1.0f, 3.0f };
diff --git a/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp
index e242fd31d3..11c9766604 100644
--- a/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp
@@ -16,6 +16,8 @@
#include <test/TensorHelpers.hpp>
+#include <numeric>
+
namespace
{
diff --git a/src/backends/reference/workloads/BaseIterator.hpp b/src/backends/reference/workloads/BaseIterator.hpp
index 483ef720f9..e09371fd96 100644
--- a/src/backends/reference/workloads/BaseIterator.hpp
+++ b/src/backends/reference/workloads/BaseIterator.hpp
@@ -456,7 +456,7 @@ public:
for (uint32_t i = 0; i < size; ++i)
{
this->operator[](i);
- decodedTensor.emplace_back(*m_Iterator);
+ decodedTensor.emplace_back(static_cast<float>(*m_Iterator));
}
return decodedTensor;
diff --git a/src/backends/reference/workloads/Reduce.cpp b/src/backends/reference/workloads/Reduce.cpp
index 392ef8e5ba..8bf422aea3 100644
--- a/src/backends/reference/workloads/Reduce.cpp
+++ b/src/backends/reference/workloads/Reduce.cpp
@@ -85,7 +85,7 @@ void Reduce(const TensorInfo& inputInfo,
{
case ReduceOperation::Mean:
case ReduceOperation::Sum:
- std::fill(tempOut.begin(), tempOut.end(), 0.0);
+ std::fill(tempOut.begin(), tempOut.end(), 0.0f);
break;
case ReduceOperation::Max:
std::fill(tempOut.begin(), tempOut.end(), -1 * std::numeric_limits<float>::max());