From d84a1a0010fc038a7da2ee7cf3ebb4f93353f1a4 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 15 Aug 2018 12:24:03 +0800 Subject: [PATCH] fc op use cpu only --- paddle/fluid/operators/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index ae37c70929..c3f7c42a82 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -158,6 +158,11 @@ function(op_library TARGET) file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(relu, MKLDNN);\n") else() file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${TARGET}, MKLDNN);\n") + # HACK: fc only have cpu kernel + if (${MKLDNN_FILE} STREQUAL "fc_mkldnn_op") + file(APPEND ${pybind_file} "USE_CPU_ONLY_OP(${TARGET});\n") + set(pybind_flag 1) + endif() endif() endif() -- GitLab