Skip to content

Commit 2d222f4

Browse files
committed
fix tracer
1 parent 9c66e1c commit 2d222f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

paddle/fluid/imperative/tracer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ paddle::framework::GarbageCollector* Tracer::MutableGarbageCollectorIfNotExists(
8383
if (gcs_.count(place) == 0) {
8484
std::unique_ptr<framework::GarbageCollector> gc;
8585
if (platform::is_gpu_place(place)) {
86-
#ifdef PADDLE_WITH_CUDA
86+
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
8787
gc.reset(new framework::DefaultStreamGarbageCollector(
8888
BOOST_GET_CONST(platform::CUDAPlace, place), 0));
8989

@@ -94,7 +94,7 @@ paddle::framework::GarbageCollector* Tracer::MutableGarbageCollectorIfNotExists(
9494
"Please recompile or reinstall Paddle with GPU support."));
9595
#endif
9696
} else if (platform::is_cuda_pinned_place(place)) {
97-
#ifdef PADDLE_WITH_CUDA
97+
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
9898
gc.reset(new framework::CUDAPinnedGarbageCollector(
9999
BOOST_GET_CONST(platform::CUDAPinnedPlace, place), 0));
100100

0 commit comments

Comments
 (0)