From a7d08db99394b37f79e1ea9755b7e1389796aaad Mon Sep 17 00:00:00 2001 From: qipengh Date: Wed, 9 Feb 2022 10:19:10 +0800 Subject: [PATCH] [MLU]fix compile and add cncl (#39394) --- paddle/fluid/platform/device/mlu/device_context.cc | 2 +- paddle/fluid/platform/device/mlu/device_context.h | 2 +- paddle/scripts/paddle_build.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/platform/device/mlu/device_context.cc b/paddle/fluid/platform/device/mlu/device_context.cc index 40bdde2653e..e737432ecb4 100644 --- a/paddle/fluid/platform/device/mlu/device_context.cc +++ b/paddle/fluid/platform/device/mlu/device_context.cc @@ -57,7 +57,7 @@ MLUDeviceContext::MLUDeviceContext(MLUPlace place) : place_(place) { MLUDeviceContext::~MLUDeviceContext() {} -Place MLUDeviceContext::GetPlace() const { return place_; } +const Place& MLUDeviceContext::GetPlace() const { return place_; } void MLUDeviceContext::Wait() const { context()->Stream()->Wait(); } diff --git a/paddle/fluid/platform/device/mlu/device_context.h b/paddle/fluid/platform/device/mlu/device_context.h index a3f3bda17c8..120916b4f5c 100644 --- a/paddle/fluid/platform/device/mlu/device_context.h +++ b/paddle/fluid/platform/device/mlu/device_context.h @@ -78,7 +78,7 @@ class MLUDeviceContext : public DeviceContext { explicit MLUDeviceContext(MLUPlace place); virtual ~MLUDeviceContext(); Eigen::DefaultDevice* eigen_device() const { return nullptr; } - Place GetPlace() const override; + const Place& GetPlace() const override; int GetComputeCapability() const; diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index d1fb2ba13bb..f4ffa35c2bd 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -226,6 +226,7 @@ function cmake_base() { -DWITH_PSLIB=${WITH_PSLIB:-OFF} -DWITH_GLOO=${gloo_flag} -DWITH_LITE=${WITH_LITE:-OFF} + -DWITH_CNCL=${WITH_CNCL:-OFF} -DWITH_XPU=${WITH_XPU:-OFF} -DWITH_MLU=${WITH_MLU:-OFF} -DLITE_GIT_TAG=release/v2.10 @@ -277,6 +278,7 @@ EOF -DLITE_GIT_TAG=release/v2.10 \ -DWITH_XPU=${WITH_XPU:-OFF} \ -DWITH_MLU=${WITH_MLU:-OFF} \ + -DWITH_CNCL=${WITH_CNCL:-OFF} \ -DXPU_SDK_ROOT=${XPU_SDK_ROOT:-""} \ -DWITH_LITE=${WITH_LITE:-OFF} \ -DWITH_XPU_BKCL=${WITH_XPU_BKCL:-OFF} \ -- GitLab