From 81508c095820c07f28938987a800cc5e398a8f0b Mon Sep 17 00:00:00 2001 From: David Gross Date: Wed, 22 Apr 2020 19:01:56 -0700 Subject: Fix "#define VERBOSE" bit-rot (build failure) Test: Build NeuralNetworksTest_static both normally and with #define VERBOSE uncommented in TestPartitioningRandom.cpp Bug: 136735929 Change-Id: I79e33239b63885b050d77b5a819b7be82a80528e --- nn/runtime/test/TestPartitioningRandom.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'nn') diff --git a/nn/runtime/test/TestPartitioningRandom.cpp b/nn/runtime/test/TestPartitioningRandom.cpp index 892cfd405..ad9007199 100644 --- a/nn/runtime/test/TestPartitioningRandom.cpp +++ b/nn/runtime/test/TestPartitioningRandom.cpp @@ -1186,6 +1186,7 @@ TEST_P(RandomPartitioningTest, Test) { { std::cout << "signatures = " << signatures.size() << ", devices = " << devices.size() << std::endl; + // TODO: When dumping steps, include non-ExecutionSteps. const ExecutionPlan& plan = c2->getExecutionPlan(); switch (plan.forTest_getKind()) { case ExecutionPlan::Kind::SIMPLE: @@ -1195,13 +1196,19 @@ TEST_P(RandomPartitioningTest, Test) { const auto& steps = plan.forTest_compoundGetSteps(); std::set devicesInPlan; for (const auto& step : steps) { - devicesInPlan.insert(step->getDevice().get()); + if (const auto* executionStep = step->tryExecutionStep()) { + devicesInPlan.insert(executionStep->getDevice().get()); + } } std::cout << "plan: compound, " << steps.size() << " steps over " << devicesInPlan.size() << " devices" << std::endl; for (unsigned i = 0; i < steps.size(); i++) { - std::cout << "Step " << i << ": " << ModelStats(steps[i]->getStepModel()) - << ", device = " << steps[i]->getDevice()->getName() << std::endl; + if (const auto executionStep = steps[i]->tryExecutionStep()) { + std::cout << "Step " << i << ": " + << ModelStats(executionStep->getStepModel()) + << ", device = " << executionStep->getDevice()->getName() + << std::endl; + } } break; } -- cgit v1.2.3