Skip to content

Commit eee3846

Browse files
committed
refine fc op use cpu only
1 parent d84a1a0 commit eee3846

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ function(op_library TARGET)
158158
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(relu, MKLDNN);\n")
159159
else()
160160
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${TARGET}, MKLDNN);\n")
161-
# HACK: fc only have cpu kernel
162-
if (${MKLDNN_FILE} STREQUAL "fc_mkldnn_op")
163-
file(APPEND ${pybind_file} "USE_CPU_ONLY_OP(${TARGET});\n")
164-
set(pybind_flag 1)
165-
endif()
166161
endif()
167162
endif()
168163

@@ -175,6 +170,9 @@ function(op_library TARGET)
175170
file(APPEND ${pybind_file} "USE_OP(fake_dequantize_max_abs);\n")
176171
elseif(${TARGET} STREQUAL "tensorrt_engine_op")
177172
message(STATUS "Pybind skips [tensorrt_engine_op], for this OP is only used in inference")
173+
elseif(${TARGET} STREQUAL "fc")
174+
# HACK: fc only have mkldnn and cpu, which would mismatch the cpu only condition
175+
file(APPEND ${pybind_file} "USE_CPU_ONLY_OP(${TARGET});\n")
178176
else()
179177
file(APPEND ${pybind_file} "USE_OP(${TARGET});\n")
180178
endif()

0 commit comments

Comments
 (0)