aboutsummaryrefslogtreecommitdiff
path: root/src/armnnCaffeParser/test/TestInputs.cpp
diff options
context:
space:
mode:
authortelsoa01 <telmo.soares@arm.com>2018-08-31 09:22:23 +0100
committertelsoa01 <telmo.soares@arm.com>2018-08-31 09:22:23 +0100
commitc577f2c6a3b4ddb6ba87a882723c53a248afbeba (patch)
treebd7d4c148df27f8be6649d313efb24f536b7cf34 /src/armnnCaffeParser/test/TestInputs.cpp
parent4c7098bfeab1ffe1cdc77f6c15548d3e73274746 (diff)
downloadarmnn-c577f2c6a3b4ddb6ba87a882723c53a248afbeba.tar.gz
Release 18.08
Diffstat (limited to 'src/armnnCaffeParser/test/TestInputs.cpp')
-rw-r--r--src/armnnCaffeParser/test/TestInputs.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/armnnCaffeParser/test/TestInputs.cpp b/src/armnnCaffeParser/test/TestInputs.cpp
index f0e2343a33..b8458de5a7 100644
--- a/src/armnnCaffeParser/test/TestInputs.cpp
+++ b/src/armnnCaffeParser/test/TestInputs.cpp
@@ -35,16 +35,18 @@ BOOST_AUTO_TEST_CASE(InputShapes)
std::string implicitInputNoShape = "name: \"Minimal\"\n"
"input: \"data\" \n";
- armnn::IRuntimePtr runtime(armnn::IRuntime::Create(armnn::Compute::CpuRef));
+ armnn::IRuntime::CreationOptions options;
+ armnn::IRuntimePtr runtime(armnn::IRuntime::Create(options));
armnnCaffeParser::ICaffeParserPtr parser(armnnCaffeParser::ICaffeParser::Create());
armnn::INetworkPtr network(nullptr, nullptr);
armnn::NetworkId netId;
// Check everything works normally
+ std::vector<armnn::Compute> backends = {armnn::Compute::CpuRef};
{
network = parser->CreateNetworkFromString(explicitInput.c_str(), {}, { "data" });
BOOST_TEST(network.get());
- runtime->LoadNetwork(netId, Optimize(*network, runtime->GetDeviceSpec()));
+ runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec()));
armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data");
armnn::TensorInfo inputTensorInfo = inputBindingInfo.second;
@@ -56,11 +58,11 @@ BOOST_AUTO_TEST_CASE(InputShapes)
BOOST_TEST(inputTensorInfo.GetShape()[3] == 4);
}
- // Check everything works with implicit input
+ // Checks everything works with implicit input.
{
network = parser->CreateNetworkFromString(implicitInput.c_str(), {}, { "data" });
BOOST_TEST(network.get());
- runtime->LoadNetwork(netId, Optimize(*network, runtime->GetDeviceSpec()));
+ runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec()));
armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data");
armnn::TensorInfo inputTensorInfo = inputBindingInfo.second;
@@ -72,11 +74,11 @@ BOOST_AUTO_TEST_CASE(InputShapes)
BOOST_TEST(inputTensorInfo.GetShape()[3] == 4);
}
- // Check everything works with implicit and passing shape
+ // Checks everything works with implicit and passing shape.
{
network = parser->CreateNetworkFromString(implicitInput.c_str(), { {"data", { 2, 2, 3, 4 } } }, { "data" });
BOOST_TEST(network.get());
- runtime->LoadNetwork(netId, Optimize(*network, runtime->GetDeviceSpec()));
+ runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec()));
armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data");
armnn::TensorInfo inputTensorInfo = inputBindingInfo.second;
@@ -88,11 +90,11 @@ BOOST_AUTO_TEST_CASE(InputShapes)
BOOST_TEST(inputTensorInfo.GetShape()[3] == 4);
}
- // Check everything works with implicit (no shape) and passing shape
+ // Checks everything works with implicit (no shape) and passing shape.
{
network = parser->CreateNetworkFromString(implicitInputNoShape.c_str(), {{"data", {2, 2, 3, 4} }}, { "data" });
BOOST_TEST(network.get());
- runtime->LoadNetwork(netId, Optimize(*network, runtime->GetDeviceSpec()));
+ runtime->LoadNetwork(netId, Optimize(*network, backends, runtime->GetDeviceSpec()));
armnnCaffeParser::BindingPointInfo inputBindingInfo = parser->GetNetworkInputBindingInfo("data");
armnn::TensorInfo inputTensorInfo = inputBindingInfo.second;
@@ -104,13 +106,13 @@ BOOST_AUTO_TEST_CASE(InputShapes)
BOOST_TEST(inputTensorInfo.GetShape()[3] == 4);
}
- // Check exception on incompatible shapes
+ // Checks exception on incompatible shapes.
{
BOOST_CHECK_THROW(parser->CreateNetworkFromString(implicitInput.c_str(), {{"data",{ 2, 2, 3, 2 }}}, {"data"}),
armnn::ParseException);
}
- // Check exception when no shape available
+ // Checks exception when no shape available.
{
BOOST_CHECK_THROW(parser->CreateNetworkFromString(implicitInputNoShape.c_str(), {}, { "data" }),
armnn::ParseException);