From b086404bf1fe0bd1d2f25e4cf8f9f8c103d98391 Mon Sep 17 00:00:00 2001 From: RedContritio Date: Fri, 19 May 2023 15:07:33 +0800 Subject: [PATCH] fix compile error on custom_devices (#53940) --- paddle/fluid/imperative/reducer.cc | 5 +++-- paddle/fluid/imperative/reducer.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/imperative/reducer.cc b/paddle/fluid/imperative/reducer.cc index 33fbfc1d337..106cff0b6c7 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 80c32c27bb6..011c8871329 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 { -- GitLab