Skip to content

Commit de2db11

Browse files
authored
Merge pull request #14537 from reyoung/feature/fix_macos_ut
fix(Cpu): fix cpu compile and unittest
2 parents d9a1f3e + 533c5d5 commit de2db11

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

paddle/fluid/pybind/pybind.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ limitations under the License. */
3737
#include "paddle/fluid/memory/allocation/allocator_strategy.h"
3838
#include "paddle/fluid/operators/activation_op.h"
3939
#include "paddle/fluid/operators/reader/lod_tensor_blocking_queue.h"
40+
#include "paddle/fluid/platform/cpu_info.h"
4041
#include "paddle/fluid/platform/enforce.h"
4142
#include "paddle/fluid/platform/init.h"
4243
#include "paddle/fluid/platform/place.h"
@@ -86,6 +87,9 @@ bool IsCompiledWithDIST() {
8687
}
8788

8889
PYBIND11_PLUGIN(core) {
90+
// Not used, just make sure cpu_info.cc is linked.
91+
paddle::platform::CpuTotalPhysicalMemory();
92+
8993
paddle::memory::allocation::UseAllocatorStrategyGFlag();
9094
py::module m("core", "C++ core of PaddlePaddle");
9195

python/paddle/fluid/tests/unittests/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ if(NOT WITH_DISTRIBUTE)
2323
LIST(REMOVE_ITEM TEST_OPS test_dist_text_classification)
2424
endif(NOT WITH_DISTRIBUTE)
2525

26-
if (${CUDNN_MAJOR_VERSION} VERSION_LESS 7)
26+
if (NOT ${WITH_GPU})
27+
LIST(REMOVE_ITEM TEST_OPS test_conv2d_fusion_op)
28+
elseif(${CUDNN_MAJOR_VERSION} VERSION_LESS 7)
2729
LIST(REMOVE_ITEM TEST_OPS test_conv2d_fusion_op)
2830
endif()
2931

0 commit comments

Comments
 (0)