diff --git a/paddle/fluid/distributed/collective/custom_ccl_tools.h b/paddle/fluid/distributed/collective/custom_ccl_tools.h index 9431c8d3e52756da356eb2500818cfa7cdcb0114..d3ebc639a3c11ce37a7d6c0759b9e79b85bc4eed 100644 --- a/paddle/fluid/distributed/collective/custom_ccl_tools.h +++ b/paddle/fluid/distributed/collective/custom_ccl_tools.h @@ -14,7 +14,12 @@ #pragma once +#if defined(__APPLE__) +#include +#else #include +#endif + #include #include "paddle/fluid/distributed/collective/types.h" diff --git a/paddle/phi/backends/device_ext.h b/paddle/phi/backends/device_ext.h index e383dde1a2e1911cd469a9d95bff4fe7786fb2fb..4563160e335a1f0fdf576143ab3c982889ff4758 100644 --- a/paddle/phi/backends/device_ext.h +++ b/paddle/phi/backends/device_ext.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#if !defined(_WIN32) && !defined(__APPLE__) +#if !defined(_WIN32) #include #include diff --git a/paddle/phi/backends/device_manager.cc b/paddle/phi/backends/device_manager.cc index cb7e77bab3fdf5e57d3d815ccd336ee27352884a..c95616150d3a6392e65d392ad7427902ec1c06a0 100644 --- a/paddle/phi/backends/device_manager.cc +++ b/paddle/phi/backends/device_manager.cc @@ -655,7 +655,11 @@ void DeviceManager::Clear() { std::vector ListAllLibraries(const std::string& library_dir) { std::vector libraries; +#if defined(__APPLE__) + std::regex express(".*\\.dylib"); +#else std::regex express(".*\\.so"); +#endif std::match_results results; #if !defined(_WIN32)