Created by: NHZlX
When we create two predictor on difference card, there is the bug:
For example:
void PrepareTRTConfig(AnalysisConfig *config, int batch_size, int id = 1) {
config->SetModel(FLAGS_dirname + "/model",
FLAGS_dirname + "/params");
config->EnableUseGpu(100, id);
config->SwitchUseFeedFetchOps(false);
}
bool test_map_cnn(int batch_size, int repeat) {
// create the predictor 1
AnalysisConfig config;
PrepareTRTConfig(&config, batch_size);
auto predictor = CreatePaddlePredictor(config);
// create the predictor 2
AnalysisConfig config1;
PrepareTRTConfig(&config1, batch_size, 2);
auto predictor1 = CreatePaddlePredictor(config1);
....
return true;
}