Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void ApplyDeviceGuard(const OperatorBase* op_base,
auto& op_device = op_base->Attr<std::string>("op_device");
if (op_device == "cpu" || phi::is_cpu_place(place)) {
VLOG(3) << "Switch into CPUPlace by device_guard.";
expected_kernel_key->place_ = phi::CPUPlace();
expected_kernel_key->place_ = CPUPlace();
} else if (op_device.find("gpu") != std::string::npos &&
phi::is_gpu_place(place)) {
// when the Op that does not have GPUKernel is assigned to GPU, the
Expand All @@ -412,7 +412,7 @@ void ApplyDeviceGuard(const OperatorBase* op_base,
if (op_base->SupportGPU()) {
expected_kernel_key->place_ = place;
} else {
expected_kernel_key->place_ = phi::CPUPlace();
expected_kernel_key->place_ = CPUPlace();
LOG_FIRST_N(WARNING, 1)
<< "Op(" << op_base->Type()
<< ") has no CUDA implementation. It will be assigned to CPUPlace.";
Expand All @@ -427,7 +427,7 @@ void ApplyDeviceGuard(const OperatorBase* op_base,
if (op_base->SupportXPU()) {
expected_kernel_key->place_ = place;
} else {
expected_kernel_key->place_ = phi::CPUPlace();
expected_kernel_key->place_ = CPUPlace();
LOG_FIRST_N(WARNING, 1)
<< "Op(" << op_base->Type()
<< ") has no XPU implementation. It will be assigned to CPUPlace.";
Expand Down Expand Up @@ -461,7 +461,7 @@ void ApplyDeviceGuard(const OperatorBase* op_base,
if (op_base->SupportCustomDevice()) {
expected_kernel_key->place_ = place;
} else {
expected_kernel_key->place_ = phi::CPUPlace();
expected_kernel_key->place_ = CPUPlace();
LOG_FIRST_N(WARNING, 1) << "Op(" << op_base->Type()
<< ") has no Custom Place implementation. It "
"will be assigned to CPUPlace.";
Expand Down
10 changes: 5 additions & 5 deletions paddle/fluid/imperative/prepared_operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ PreparedOp PrepareImpl(
VLOG(6) << "Dynamic mode PrepareImpl - kernel name: " << phi_kernel_name
<< " | kernel key: " << phi_cpu_kernel_key
<< " | kernel: " << phi_cpu_kernel;
auto* cpu_ctx = pool.Get(phi::CPUPlace());
auto* cpu_ctx = pool.Get(CPUPlace());
return PreparedOp(op,
empty_ctx,
phi_cpu_kernel_key,
Expand Down Expand Up @@ -472,7 +472,7 @@ PreparedOp PrepareImpl(
VLOG(3) << "fluid missing XPU kernel: " << op.Type()
<< ", expected_kernel_key:" << fluid_kernel_type
<< ", fallbacking to CPU one!";
fluid_kernel_type.place_ = phi::CPUPlace();
fluid_kernel_type.place_ = CPUPlace();
kernel_iter = kernels.find(fluid_kernel_type);
}
#endif
Expand All @@ -496,7 +496,7 @@ PreparedOp PrepareImpl(
VLOG(3) << "fluid missing XPU kernel: " << op.Type()
<< ", expected_kernel_key:" << fluid_kernel_type
<< ", fallbacking to CPU one!";
fluid_kernel_type.place_ = phi::CPUPlace();
fluid_kernel_type.place_ = CPUPlace();
kernel_iter = kernels.find(fluid_kernel_type);
}
}
Expand All @@ -507,7 +507,7 @@ PreparedOp PrepareImpl(
VLOG(3) << "missing IPU kernel: " << op.Type()
<< ", expected_kernel_key:" << fluid_kernel_type
<< ", fallbacking to CPU one!";
fluid_kernel_type.place_ = phi::CPUPlace();
fluid_kernel_type.place_ = CPUPlace();
kernel_iter = kernels.find(fluid_kernel_type);
}
#endif
Expand All @@ -517,7 +517,7 @@ PreparedOp PrepareImpl(
VLOG(3) << "missing " << place.GetDeviceType() << " kernel: " << op.Type()
<< ", expected_kernel_key:" << expected_kernel_key
<< ", fallbacking to CPU one!";
fluid_kernel_type.place_ = phi::CPUPlace();
fluid_kernel_type.place_ = CPUPlace();
kernel_iter = kernels.find(fluid_kernel_type);
}
#endif
Expand Down
Loading