提交 90f3a421 编写于 作者: L Liu Yiqun

Change the argument's type from reference to pointer.

上级 2d1d677e
......@@ -23,8 +23,8 @@ limitations under the License. */
void ThreadedRunInference(
const std::unique_ptr<paddle::framework::ProgramDesc>& inference_program,
const paddle::framework::Executor& executor,
paddle::framework::Scope* scope, const int thread_id,
paddle::framework::Executor* executor, paddle::framework::Scope* scope,
const int thread_id,
const std::vector<paddle::framework::LoDTensor*>& cpu_feeds,
const std::vector<paddle::framework::LoDTensor*>& cpu_fetchs) {
auto copy_program = std::unique_ptr<paddle::framework::ProgramDesc>(
......@@ -56,7 +56,7 @@ void ThreadedRunInference(
}
// 6. Run the inference program
executor.Run(*copy_program, scope, feed_targets, fetch_targets,
executor->Run(*copy_program, scope, feed_targets, fetch_targets,
feed_holder_name, fetch_holder_name);
}
......@@ -78,8 +78,8 @@ void TestMultiThreadInference(
std::vector<std::thread*> threads;
for (int i = 0; i < num_threads; ++i) {
threads.push_back(new std::thread(
ThreadedRunInference, std::ref(inference_program), std::ref(executor),
scope, i, std::ref(cpu_feeds[i]), std::ref(cpu_fetchs[i])));
ThreadedRunInference, std::ref(inference_program), &executor, scope, i,
std::ref(cpu_feeds[i]), std::ref(cpu_fetchs[i])));
}
for (int i = 0; i < num_threads; ++i) {
threads[i]->join();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册