Skip to content

Commit 533c5d5

Browse files
committed
fix(Cpu): fix cpu compile and unittest
test=develop
1 parent dc75cc9 commit 533c5d5

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
@@ -46,6 +46,7 @@ limitations under the License. */
4646
#include "paddle/fluid/memory/allocation/allocator_strategy.h"
4747
#include "paddle/fluid/operators/activation_op.h"
4848
#include "paddle/fluid/operators/reader/lod_tensor_blocking_queue.h"
49+
#include "paddle/fluid/platform/cpu_info.h"
4950
#include "paddle/fluid/platform/enforce.h"
5051
#include "paddle/fluid/platform/init.h"
5152
#include "paddle/fluid/platform/place.h"
@@ -95,6 +96,9 @@ bool IsCompiledWithDIST() {
9596
}
9697

9798
PYBIND11_PLUGIN(core) {
99+
// Not used, just make sure cpu_info.cc is linked.
100+
paddle::platform::CpuTotalPhysicalMemory();
101+
98102
paddle::memory::allocation::UseAllocatorStrategyGFlag();
99103
py::module m("core", "C++ core of PaddlePaddle");
100104

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)