From f769f292ba506784c8d21d691de821f4e3b53fec Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Fri, 25 Jun 2021 12:53:09 +0100 Subject: IVGCVSW-6178 Add additional compiler warnings to the driver Signed-off-by: Finn Williams Change-Id: I2209251736a095583fffc8da774188e0dccfc932 --- 1.0/HalPolicy.cpp | 1 - Android.mk | 9 +++++++++ ConversionUtils_1_2.hpp | 6 ++---- ModelToINetworkConverter.cpp | 3 --- 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(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(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(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::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::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()); -- cgit v1.2.1