paddle/fluid/framework/new_executor/stream_analyzer.cc
bool StreamAnalyzer::IsDirectRun(Instruction& cur_instr,
                                 const Instruction& next_instr) {
  return (cur_instr.dev_ctx_ == next_instr.dev_ctx_ ||
          interpretercore::IsMemcpyD2H(cur_instr) ||
          interpretercore::IsMemcpyH2D(next_instr));
}
/*
 * NOTE(dev): The following cases are considered as directly run:
 *
 *  1. with same dev_ctx_, such as: CPU -> CPU, GPU -> GPU
 *  2. D2H -> CPU
 *  3. CPU -> H2D
 */
The following cases are considered as directly run:
1.
The following cases are considered as directly run : 1 .
bool StreamAnalyzer::IsDirectRun(Instruction& cur_instr,
                                 const Instruction& next_instr) {
  return (cur_instr.dev_ctx_ == next_instr.dev_ctx_ ||
          interpretercore::IsMemcpyD2H(cur_instr) ||
          interpretercore::IsMemcpyH2D(next_instr));
}
bool StreamAnalyzer :: IsDirectRun ( Instruction & cur_instr , const Instruction & next_instr ) { return ( cur_instr . dev_ctx_ == next_instr . dev_ctx_ || interpretercore :: IsMemcpyD2H ( cur_instr ) || interpretercore :: IsMemcpyH2D ( next_instr ) ) ; }
NOTE(dev): The following cases are considered as directly run:
  1. with same dev_ctx_, such as: CPU -> CPU, GPU -> GPU
  2.
NOTE ( dev ) : The following cases are considered as directly run : 1 . with same dev_ctx_ such as : CPU - > CPU GPU - > GPU 2 .