aboutsummaryrefslogtreecommitdiff
path: root/src/armnnDeserializer
diff options
context:
space:
mode:
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>2020-04-01 16:51:23 +0100
committerNarumol Prangnawarat <narumol.prangnawarat@arm.com>2020-04-06 09:06:01 +0100
commitac2770a4bb6461bfbddec928bb6208f26f898f02 (patch)
treec72f67f648b7aca2f4bccf69b05d185bf5f9ccad /src/armnnDeserializer
parent7ee5d2c3b3cee5a924ed6347fef613ee07b5aca7 (diff)
downloadarmnn-ac2770a4bb6461bfbddec928bb6208f26f898f02.tar.gz
IVGCVSW-4485 Remove Boost assert
* Change boost assert to armnn assert * Change include file to armnn assert * Fix ARMNN_ASSERT_MSG issue with multiple conditions * Change BOOST_ASSERT to BOOST_TEST where appropriate * Remove unused include statements Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I5d0fa3a37b7c1c921216de68f0073aa34702c9ff
Diffstat (limited to 'src/armnnDeserializer')
-rw-r--r--src/armnnDeserializer/Deserializer.cpp26
-rw-r--r--src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp6
2 files changed, 16 insertions, 16 deletions
diff --git a/src/armnnDeserializer/Deserializer.cpp b/src/armnnDeserializer/Deserializer.cpp
index 58232a2763..2975675ff1 100644
--- a/src/armnnDeserializer/Deserializer.cpp
+++ b/src/armnnDeserializer/Deserializer.cpp
@@ -13,6 +13,7 @@
#include <armnnUtils/Permute.hpp>
#include <armnnUtils/Transpose.hpp>
+#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <ParserHelper.hpp>
@@ -20,7 +21,6 @@
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
-#include <boost/assert.hpp>
#include <boost/format.hpp>
#include <boost/format.hpp>
#include <boost/numeric/conversion/cast.hpp>
@@ -725,7 +725,7 @@ Deserializer::GraphPtr Deserializer::LoadGraphFromBinary(const uint8_t* binaryCo
INetworkPtr Deserializer::CreateNetworkFromGraph(GraphPtr graph)
{
m_Network = INetwork::Create();
- BOOST_ASSERT(graph != nullptr);
+ ARMNN_ASSERT(graph != nullptr);
unsigned int layerIndex = 0;
for (AnyLayer const* layer : *graph->layers())
{
@@ -883,7 +883,7 @@ void Deserializer::SetupInputLayers(GraphPtr graph)
// GetBindingLayerInfo expect the index to be index in the vector not index property on each layer base
LayerBindingId bindingId = GetBindingLayerInfo(graph, inputLayerIndex);
- BOOST_ASSERT_MSG(baseLayer->layerName()->c_str(), "Input has no name.");
+ ARMNN_ASSERT_MSG(baseLayer->layerName()->c_str(), "Input has no name.");
IConnectableLayer* inputLayer =
m_Network->AddInputLayer(bindingId, baseLayer->layerName()->c_str());
@@ -922,7 +922,7 @@ void Deserializer::SetupOutputLayers(GraphPtr graph)
// GetBindingLayerInfo expect the index to be index in the vector not index property on each layer base
LayerBindingId bindingId = GetBindingLayerInfo(graph, outputLayerIndex);
- BOOST_ASSERT_MSG(baseLayer->layerName()->c_str(), "Input has no name.");
+ ARMNN_ASSERT_MSG(baseLayer->layerName()->c_str(), "Input has no name.");
IConnectableLayer* outputLayer =
m_Network->AddOutputLayer(bindingId, baseLayer->layerName()->c_str());
@@ -944,7 +944,7 @@ void Deserializer::RegisterOutputSlots(GraphPtr graph,
IConnectableLayer* layer)
{
CHECK_LAYERS(graph, 0, layerIndex);
- BOOST_ASSERT(layer != nullptr);
+ ARMNN_ASSERT(layer != nullptr);
LayerBaseRawPtr baseLayer = GetBaseLayer(graph, layerIndex);
if (baseLayer->outputSlots()->size() != layer->GetNumOutputSlots())
{
@@ -971,7 +971,7 @@ void Deserializer::RegisterInputSlots(GraphPtr graph,
armnn::IConnectableLayer* layer)
{
CHECK_LAYERS(graph, 0, layerIndex);
- BOOST_ASSERT(layer != nullptr);
+ ARMNN_ASSERT(layer != nullptr);
LayerBaseRawPtr baseLayer = GetBaseLayer(graph, layerIndex);
if (baseLayer->inputSlots()->size() != layer->GetNumInputSlots())
{
@@ -1845,7 +1845,7 @@ armnn::Pooling2dDescriptor Deserializer::GetPoolingDescriptor(Deserializer::Pool
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported pooling algorithm");
+ ARMNN_ASSERT_MSG(false, "Unsupported pooling algorithm");
}
}
@@ -1863,7 +1863,7 @@ armnn::Pooling2dDescriptor Deserializer::GetPoolingDescriptor(Deserializer::Pool
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported output shape rounding");
+ ARMNN_ASSERT_MSG(false, "Unsupported output shape rounding");
}
}
@@ -1881,7 +1881,7 @@ armnn::Pooling2dDescriptor Deserializer::GetPoolingDescriptor(Deserializer::Pool
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported padding method");
+ ARMNN_ASSERT_MSG(false, "Unsupported padding method");
}
}
@@ -1899,7 +1899,7 @@ armnn::Pooling2dDescriptor Deserializer::GetPoolingDescriptor(Deserializer::Pool
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported data layout");
+ ARMNN_ASSERT_MSG(false, "Unsupported data layout");
}
}
@@ -2197,7 +2197,7 @@ armnn::NormalizationDescriptor Deserializer::GetNormalizationDescriptor(
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported normalization channel type");
+ ARMNN_ASSERT_MSG(false, "Unsupported normalization channel type");
}
}
@@ -2215,7 +2215,7 @@ armnn::NormalizationDescriptor Deserializer::GetNormalizationDescriptor(
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported normalization method type");
+ ARMNN_ASSERT_MSG(false, "Unsupported normalization method type");
}
}
@@ -2233,7 +2233,7 @@ armnn::NormalizationDescriptor Deserializer::GetNormalizationDescriptor(
}
default:
{
- BOOST_ASSERT_MSG(false, "Unsupported data layout");
+ ARMNN_ASSERT_MSG(false, "Unsupported data layout");
}
}
diff --git a/src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp b/src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp
index 91d07f304a..bb38d5f4b4 100644
--- a/src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp
+++ b/src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp
@@ -14,10 +14,10 @@
#include <ArmnnSchema_generated.h>
#include <armnn/IRuntime.hpp>
#include <armnnDeserializer/IDeserializer.hpp>
+#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <ResolveType.hpp>
-#include <boost/assert.hpp>
#include <boost/format.hpp>
@@ -96,10 +96,10 @@ struct ParserFlatbuffersSerializeFixture
flatbuffers::Parser parser;
bool ok = parser.Parse(schemafile.c_str());
- BOOST_ASSERT_MSG(ok, "Failed to parse schema file");
+ ARMNN_ASSERT_MSG(ok, "Failed to parse schema file");
ok &= parser.Parse(m_JsonString.c_str());
- BOOST_ASSERT_MSG(ok, "Failed to parse json input");
+ ARMNN_ASSERT_MSG(ok, "Failed to parse json input");
if (!ok)
{