Skip to content

Commit

Permalink
[new-exec] set type of op-kernel op by place (#39458)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu authored Feb 11, 2022
1 parent 8803f6b commit 7392578
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion paddle/fluid/framework/new_executor/interpretercore_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,15 @@ void deal_operator_base(const platform::Place& place,
auto* dev_ctx = pool.Get(place);
// input, output is prepared. set the other attributes.
op_func_node->operator_base_ = op_base;
op_func_node->type_ = OpFuncType::kQueueSync; // alway Sync
if (platform::is_gpu_place(place)) {
op_func_node->type_ = OpFuncType::kQueueAsync;
} else if (platform::is_cpu_place(place)) {
op_func_node->type_ = OpFuncType::kQueueSync;
} else {
PADDLE_THROW(
platform::errors::Fatal("Unsupported current place %s", place));
}

op_func_node->kernel_func_ = nullptr;
op_base->Run(*local_scope, place); // Run without data transformer.

Expand Down

0 comments on commit 7392578

Please sign in to comment.