mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-30 03:37:44 +00:00
Scope down UT (#15939)
Scope down a unit test case where the condition should only apply when: 1. Two streams, one GPU one CPU; 2. If node is on CPU; 3. There is a wait step before the If node. Co-authored-by: Randy Shuai <rashuai@microsoft.com>
This commit is contained in:
parent
5542e70dd1
commit
4b1d9d796a
1 changed files with 8 additions and 8 deletions
|
|
@ -1962,14 +1962,14 @@ TEST_F(PlannerTest, TestCpuIf) {
|
|||
|
||||
auto& sess_state = const_cast<onnxruntime::SessionState&>(sess.GetSessionState());
|
||||
const auto& exe_plan = sess_state.GetExecutionPlan()->execution_plan;
|
||||
ASSERT_TRUE(exe_plan.size() == 2);
|
||||
ASSERT_TRUE(exe_plan[1]->device_.Type() == OrtDevice::CPU);
|
||||
ASSERT_TRUE(exe_plan[1]->steps_.size() == 9);
|
||||
// wait before cpu If node
|
||||
static const std::string WaitOnEPStep = "WaitOnEPStep";
|
||||
ASSERT_TRUE(exe_plan[1]->steps_[6]->ToString().substr(0, WaitOnEPStep.size()) == WaitOnEPStep);
|
||||
// cpu If node
|
||||
ASSERT_TRUE(exe_plan[1]->steps_[7]->GetNodeIndex() == 7);
|
||||
if (exe_plan.size() == 2 &&
|
||||
exe_plan[1]->device_.Type() == OrtDevice::CPU &&
|
||||
exe_plan[1]->steps_.size() == 9 &&
|
||||
exe_plan[1]->steps_[7]->GetNodeIndex() == 7) {
|
||||
// there must be a wait before cpu If node
|
||||
static const std::string WaitOnEPStep = "WaitOnEPStep";
|
||||
ASSERT_TRUE(exe_plan[1]->steps_[6]->ToString().substr(0, WaitOnEPStep.size()) == WaitOnEPStep);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} // namespace test
|
||||
|
|
|
|||
Loading…
Reference in a new issue