|
|
|
@ -175,12 +175,20 @@ AnalysisConfig::AnalysisConfig(const AnalysisConfig &other) {
|
|
|
|
|
|
|
|
|
|
#undef CP_MEMBER
|
|
|
|
|
|
|
|
|
|
// Update();
|
|
|
|
|
// Update() will reset all the passes, when some tensorRT pass is deleted in
|
|
|
|
|
// other.pass_builder(), it will set again, so just copy the passes.
|
|
|
|
|
pass_builder_->ClearPasses();
|
|
|
|
|
for (const std::string &pass : other.pass_builder()->AllPasses()) {
|
|
|
|
|
pass_builder_->AppendPass(pass);
|
|
|
|
|
Update();
|
|
|
|
|
if (use_tensorrt_) {
|
|
|
|
|
// Update() will reset all the passes, when some tensorRT pass is deleted in
|
|
|
|
|
// other.pass_builder(), it will set again, so we just remove the
|
|
|
|
|
// deleted_pass.
|
|
|
|
|
auto all_passes = kTRTSubgraphPasses;
|
|
|
|
|
auto other_passes = other.pass_builder()->AllPasses();
|
|
|
|
|
std::vector<std::string> deleted_passes;
|
|
|
|
|
std::set_difference(all_passes.begin(), all_passes.end(),
|
|
|
|
|
other_passes.begin(), other_passes.end(),
|
|
|
|
|
std::inserter(deleted_passes, deleted_passes.begin()));
|
|
|
|
|
for (auto ps : deleted_passes) {
|
|
|
|
|
pass_builder_->DeletePass(ps);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|