Skip to content

Commit

Permalink
fix no place.device
Browse files Browse the repository at this point in the history
  • Loading branch information
pangyoki committed Apr 5, 2022
1 parent 8be37f5 commit a0835a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paddle/fluid/imperative/tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ void Tracer::SetExpectedPlace(platform::Place place) {
expected_place_ = place;
if (platform::is_gpu_place(place)) {
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
platform::SetDeviceId(place.device);
if (place.device) {
platform::SetDeviceId(place.device);
}
#else
PADDLE_THROW(platform::errors::PreconditionNotMet(
"PaddlePaddle should compile with GPU if use CUDAPlace."));
Expand Down

0 comments on commit a0835a1

Please sign in to comment.