From b1c3f9f1b9724e4a8b7578ff4668f41997778cab Mon Sep 17 00:00:00 2001 From: nidefawl <637382+nidefawl@users.noreply.github.com> Date: Tue, 16 Jan 2024 23:28:14 +0000 Subject: [PATCH] Fix missing mkl-dnn include paths (#117492) Fixes #91968 and #100960 This commit fixes missing include paths by linking `caffe2_pybind11_state_gpu` against `caffe2::mkldnn` Pull Request resolved: https://github.com/pytorch/pytorch/pull/117492 Approved by: https://github.com/ezyang --- caffe2/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt index f1394b62b82555..91ff6e4052a81a 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt @@ -1971,6 +1971,9 @@ if(BUILD_PYTHON) target_include_directories(caffe2_pybind11_state_gpu PRIVATE ${Caffe2_CPU_INCLUDE}) target_link_libraries(caffe2_pybind11_state_gpu PRIVATE torch_library python::python pybind::pybind11) + if(USE_MKLDNN) + target_link_libraries(caffe2_pybind11_state_gpu PRIVATE caffe2::mkldnn) + endif() if(WIN32) target_link_libraries(caffe2_pybind11_state_gpu PRIVATE onnx_proto) endif(WIN32)