Skip to content

Commit f7a54b5

Browse files
authored
Merge pull request #9881 from mozga-intel/mozga-intel/fc_without_mkldnn
The fully connected: the operator is removed when the MKLDNN flag is OFF
2 parents c241959 + d24b5e0 commit f7a54b5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,17 @@ op_library(channel_send_op DEPS concurrency)
245245
op_library(channel_recv_op DEPS concurrency)
246246

247247
list(REMOVE_ITEM GENERAL_OPS ${DEPS_OPS})
248+
249+
# The fully connected layer is deleted when the WITH_MKLDNN flag is OFF
250+
# Because the fully connected layer has only one MKLDNN's operator
251+
if(NOT WITH_MKLDNN)
252+
list(REMOVE_ITEM GENERAL_OPS fc_op)
253+
endif(NOT WITH_MKLDNN)
254+
248255
foreach(src ${GENERAL_OPS})
249256
op_library(${src})
250257
endforeach()
258+
251259
file(APPEND ${pybind_file} "USE_OP(less_than);\nUSE_OP(logical_and);\nUSE_NO_KERNEL_OP(read_from_array);\n")
252260

253261
add_subdirectory(reader)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
22
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
33

4+
# The fully connected test is removed whe the WITH_MKLDNN flag is OFF
5+
# Because the fully connected layer has only one kernel (MKLDNN)
6+
if(NOT WITH_MKLDNN)
7+
list(REMOVE_ITEM TEST_OPS test_fc_op)
8+
endif(NOT WITH_MKLDNN)
9+
410
if(NOT WITH_DISTRIBUTE)
511
list(REMOVE_ITEM TEST_OPS test_recv_op)
612
endif(NOT WITH_DISTRIBUTE)

0 commit comments

Comments
 (0)