aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2021-06-25 12:53:09 +0100
committerFinn Williams <Finn.Williams@arm.com>2021-06-25 13:14:45 +0100
commitf769f292ba506784c8d21d691de821f4e3b53fec (patch)
tree786c90044689299d84962b263120cc3ca8ca41b7
parentd27c13b273f265dc5dffd803728d6f913679834e (diff)
downloadandroid-nn-driver-f769f292ba506784c8d21d691de821f4e3b53fec.tar.gz
IVGCVSW-6178 Add additional compiler warnings to the driver
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I2209251736a095583fffc8da774188e0dccfc932
-rw-r--r--1.0/HalPolicy.cpp1
-rw-r--r--Android.mk9
-rw-r--r--ConversionUtils_1_2.hpp6
-rw-r--r--ModelToINetworkConverter.cpp3
4 files changed, 11 insertions, 8 deletions
diff --git a/1.0/HalPolicy.cpp b/1.0/HalPolicy.cpp
index 7e9e9efa..d4d61211 100644
--- a/1.0/HalPolicy.cpp
+++ b/1.0/HalPolicy.cpp
@@ -604,7 +604,6 @@ bool HalPolicy::ConvertSpaceToDepth(const Operation& operation, const Model& mod
}
armnn::SpaceToDepthDescriptor desc;
- bool dataLayoutCheck;
GetInputScalar<hal_1_0::HalPolicy>(operation, 1, OperandType::INT32, desc.m_BlockSize, model, data);
diff --git a/Android.mk b/Android.mk
index 06b95a1a..1b4e248b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -269,6 +269,9 @@ LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
-fexceptions \
-Werror \
+ -Wall \
+ -Wextra \
+ -Wno-unused-function \
-Wno-format-security \
-DARMNN_ANDROID_NN_V1_1
@@ -392,6 +395,9 @@ LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
-fexceptions \
-Werror \
+ -Wall \
+ -Wextra \
+ -Wno-unused-function \
-Wno-format-security \
-DARMNN_ANDROID_NN_V1_2
@@ -514,6 +520,9 @@ LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
-fexceptions \
-Werror \
+ -Wall \
+ -Wextra \
+ -Wno-unused-function \
-Wno-format-security \
-DARMNN_ANDROID_NN_V1_3 \
diff --git a/ConversionUtils_1_2.hpp b/ConversionUtils_1_2.hpp
index c66a2f59..a95b1c12 100644
--- a/ConversionUtils_1_2.hpp
+++ b/ConversionUtils_1_2.hpp
@@ -463,7 +463,6 @@ bool ConvertDepthwiseConv2d_1_2(const HalOperation& operation, const HalModel& m
desc.m_DataLayout = OptionalDataLayout<HalPolicy>(operation, dataLayoutFlagIndex, model, data);
armnnUtils::DataLayoutIndexed dataLayoutIndexed(desc.m_DataLayout);
- unsigned int channelsIndex = dataLayoutIndexed.GetChannelsIndex();
unsigned int widthIndex = dataLayoutIndexed.GetWidthIndex();
unsigned int heightIndex = dataLayoutIndexed.GetHeightIndex();
@@ -780,7 +779,7 @@ bool ConvertGather(const HalOperation& operation, const HalModel& model, Convers
__func__, outputDimensions, inputDimensions, indicesDimensions);
}
- int32_t axis;
+ uint32_t axis;
if (!GetInputScalar<HalPolicy>(operation, 1, HalOperandType::INT32, axis, model, data))
{
return Fail("%s: Operation has invalid or unsupported axis operand", __func__);
@@ -890,7 +889,6 @@ bool ConvertGroupedConv2d(const HalOperation& operation, const HalModel& model,
const TensorShape& inputShape = inputInfo.GetShape();
const TensorShape& outputShape = outputInfo.GetShape();
const TensorShape& weightsShape = weights.GetShape();
- const TensorShape& biasesShape = biases.GetShape();
armnnUtils::DataLayoutIndexed dataLayoutIndexed(dataLayout);
const unsigned int channelsIndex = dataLayoutIndexed.GetChannelsIndex();
@@ -901,7 +899,7 @@ bool ConvertGroupedConv2d(const HalOperation& operation, const HalModel& model,
desc.m_DataLayout = dataLayout;
desc.m_BiasEnabled = true;
- int numGroups;
+ unsigned int numGroups;
ActivationFn activation;
if (operation.inputs.size() == 12)
diff --git a/ModelToINetworkConverter.cpp b/ModelToINetworkConverter.cpp
index 41716b0f..4665ef16 100644
--- a/ModelToINetworkConverter.cpp
+++ b/ModelToINetworkConverter.cpp
@@ -95,7 +95,6 @@ void ModelToINetworkConverter<HalPolicy>::Convert()
ALOGV("ModelToINetworkConverter::Convert(): getMainModel(m_Model).operands[inputIndex];");
const HalOperand& operand = getMainModel(m_Model).operands[inputIndex];
ALOGV("ModelToINetworkConverter::Convert(): GetTensorInfoForOperand(operand)");
- const armnn::TensorInfo& tensor = GetTensorInfoForOperand(operand);
const std::string layerName = "Input_" + std::to_string(i);
ALOGV("ModelToINetworkConverter::Convert(): m_Data.m_Network->AddInputLayer(i, layerName.c_str())");
armnn::IConnectableLayer* layer = m_Data.m_Network->AddInputLayer(i, layerName.c_str());
@@ -192,8 +191,6 @@ void ModelToINetworkConverter<HalPolicy>::Convert()
{
// outputs in android nn are represented by operands
uint32_t outputIndex = getMainModel(m_Model).outputIndexes[i];
- const HalOperand& operand = getMainModel(m_Model).operands[outputIndex];
- const armnn::TensorInfo& tensor = GetTensorInfoForOperand(operand);
const std::string layerName = "Output_" + std::to_string(i);
armnn::IConnectableLayer* layer = m_Data.m_Network->AddOutputLayer(i, layerName.c_str());