From 93667b1d7c361df68bdb1d733f17aba3ba34e046 Mon Sep 17 00:00:00 2001 From: Rob Hughes Date: Mon, 23 Sep 2019 16:24:05 +0100 Subject: [PATCH] Replace uses of non-standard C++: * Variable-length array replaced with std::vector * "and" replaced with "&&" (OK, this one is standard but MSVC doesn't like it and it's inconsistent with the rest of the codebase) * Replace u_int8_t with uint8_t Change-Id: I7b968a2cfa85a5492a2a547364464c594efb067b Signed-off-by: Rob Hughes --- src/backends/backendsCommon/WorkloadUtils.cpp | 6 +++--- tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backends/backendsCommon/WorkloadUtils.cpp b/src/backends/backendsCommon/WorkloadUtils.cpp index 3185ba0..9e008ca 100644 --- a/src/backends/backendsCommon/WorkloadUtils.cpp +++ b/src/backends/backendsCommon/WorkloadUtils.cpp @@ -82,7 +82,7 @@ ConstTensor ReorderWeightChannelsForAcl(const ConstTensor& weightHandle, DataLay break; } - DataType weightAclOrder[height*width*inputChannels*multiplier]; + std::vector weightAclOrder(height*width*inputChannels*multiplier); unsigned int destinationWeightsChannel; unsigned int totalChannels = inputChannels * multiplier; unsigned int channelSize = height * width; @@ -105,7 +105,7 @@ ConstTensor ReorderWeightChannelsForAcl(const ConstTensor& weightHandle, DataLay } } - ::memcpy(permuteBuffer, weightAclOrder, weightHandle.GetInfo().GetNumBytes()); + ::memcpy(permuteBuffer, weightAclOrder.data(), weightHandle.GetInfo().GetNumBytes()); return ConstTensor(weightHandle.GetInfo(), permuteBuffer); } @@ -158,7 +158,7 @@ armnn::ConstTensor ConvertWeightTensorFromArmnnToAcl(const ConstCpuTensorHandle* ConstTensor weightPermuted = PermuteTensor(weightTensor, permutationVector, permuteBuffer); // Shuffle the weights data to obtain the channel order needed used by Acl - if (multiplier > 1 and inputChannels > 1 and dataLayout == DataLayout::NCHW) + if (multiplier > 1 && inputChannels > 1 && dataLayout == DataLayout::NCHW) { switch (weightPermuted.GetDataType()) { diff --git a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp index 635eaf3..eefe628 100644 --- a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp +++ b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp @@ -161,7 +161,7 @@ auto ParseDataArray(std::istream& stream, [&quantizationScale, &quantizationOffset](const std::string & s) { return boost::numeric_cast( - armnn::Quantize(std::stof(s), + armnn::Quantize(std::stof(s), quantizationScale, quantizationOffset)); }); -- 2.7.4