diff --git a/paddle/fluid/framework/CMakeLists.txt b/paddle/fluid/framework/CMakeLists.txt index 369dc395fae79f36066b01a1e1fab3552719eaea..fc20b61f36a209b21a335a7b122d7396575da5b9 100755 --- a/paddle/fluid/framework/CMakeLists.txt +++ b/paddle/fluid/framework/CMakeLists.txt @@ -188,6 +188,13 @@ cc_library( if(WITH_GPU) target_link_libraries(var_type_traits dynload_cuda) endif() + +# every source file that includes "dnnl.h" must depends on mkldnn +# or, the first one should depends on mkldnn +if(WITH_MKLDNN) + add_dependencies(var_type_traits mkldnn) +endif() + cc_test( var_type_traits_test SRCS var_type_traits_test.cc