diff --git a/paddle/fluid/imperative/reducer.cc b/paddle/fluid/imperative/reducer.cc index 33fbfc1d33746edbb447617f0c1d9ff3a5adb288..106cff0b6c7e31959c4273223b44ee43a5c49fcf 100644 --- a/paddle/fluid/imperative/reducer.cc +++ b/paddle/fluid/imperative/reducer.cc @@ -29,8 +29,9 @@ namespace paddle { namespace imperative { -#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \ - defined(PADDLE_WITH_XPU_BKCL) || defined(PADDLE_WITH_GLOO) +#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \ + defined(PADDLE_WITH_XPU_BKCL) || defined(PADDLE_WITH_GLOO) || \ + defined(PADDLE_WITH_CUSTOM_DEVICE) // div the nranks void Group::DivNRanks(const platform::DeviceContext &context, int64_t nranks) { phi::DenseTensor *tensor = diff --git a/paddle/fluid/imperative/reducer.h b/paddle/fluid/imperative/reducer.h index 80c32c27bb69e30c7dcc925b89d472b67833649e..011c8871329a55dba6b4d9e945ff096f2ab7394a 100644 --- a/paddle/fluid/imperative/reducer.h +++ b/paddle/fluid/imperative/reducer.h @@ -44,8 +44,9 @@ class VariableWrapper; namespace paddle { namespace imperative { -#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \ - defined(PADDLE_WITH_XPU_BKCL) || defined(PADDLE_WITH_GLOO) +#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) || \ + defined(PADDLE_WITH_XPU_BKCL) || defined(PADDLE_WITH_GLOO) || \ + defined(PADDLE_WITH_CUSTOM_DEVICE) template struct DivNRanksFunctor {