@@ -52,8 +52,12 @@ namespace cub = hipcub;
5252#include " env.h"
5353#include " paddle/extension.h"
5454#include " paddle/phi/core/allocator.h"
55+ // TODO (yuzhe): remove ifndef PADDLE_WITH_COREX when
56+ // https://github.com/PaddlePaddle/Paddle/pull/78813 merged
57+ #ifndef PADDLE_WITH_COREX
5558#include " paddle/phi/core/memory/allocation/allocator_facade.h"
5659#include " paddle/phi/backends/gpu/cuda/cuda_graph.h"
60+ #endif
5761#ifdef PADDLE_WITH_CUSTOM_DEVICE
5862#include " paddle/phi/backends/custom/custom_context.h"
5963#else
@@ -376,7 +380,9 @@ inline paddle::Tensor GetEmptyTensor(const common::DDim &dims,
376380 const paddle::DataType &dtype,
377381 const paddle::Place &place) {
378382 phi::Allocator *allocator = nullptr ;
379- #if defined(PADDLE_WITH_CUDA)
383+ // TODO (yuzhe): remove !defined(PADDLE_WITH_COREX) when
384+ // https://github.com/PaddlePaddle/Paddle/pull/78813 merged
385+ #if defined(PADDLE_WITH_CUDA) && !defined(PADDLE_WITH_COREX)
380386 if (phi::backends::gpu::CUDAGraph::IsThisThreadCapturing ()) {
381387 allocator = paddle::memory::allocation::AllocatorFacade::Instance ()
382388 .GetAllocator (place)
@@ -399,7 +405,9 @@ inline paddle::Tensor GetEmptyTensor(const common::DDim &dims,
399405 const paddle::DataType &dtype,
400406 const paddle::Place &place) {
401407 phi::Allocator *allocator = nullptr ;
402- #if defined(PADDLE_WITH_CUDA)
408+ // TODO (yuzhe): remove !defined(PADDLE_WITH_COREX) when
409+ // https://github.com/PaddlePaddle/Paddle/pull/78813 merged
410+ #if defined(PADDLE_WITH_CUDA) && !defined(PADDLE_WITH_COREX)
403411 if (phi::backends::gpu::CUDAGraph::IsThisThreadCapturing ()) {
404412 allocator = paddle::memory::allocation::AllocatorFacade::Instance ()
405413 .GetAllocator (place)
0 commit comments