diff -ruN mkl-dnn-1.2/include/dnnl.hpp mkl-dnn-1.2-patch/include/dnnl.hpp --- mkl-dnn-1.2/include/dnnl.hpp 2020-01-25 06:54:36.000000000 +0900 +++ mkl-dnn-1.2-patch/include/dnnl.hpp 2020-02-03 12:04:59.085778234 +0900 @@ -106,6 +106,8 @@ static void wrap_c_api(dnnl_status_t status, const char *message) { if (status != dnnl_success) DNNL_THROW_ERROR(status, message); } + + const std::string& toStdString() { return std::string(message).append(": status = ").append(std::to_string(status)); } }; /// A class that provides the destructor for a DNNL C API handle. diff -ruN mkl-dnn-1.2/src/CMakeLists.txt mkl-dnn-1.2-patch/src/CMakeLists.txt --- mkl-dnn-1.2/src/CMakeLists.txt 2020-01-25 06:54:36.000000000 +0900 +++ mkl-dnn-1.2-patch/src/CMakeLists.txt 2020-02-03 12:05:40.463770968 +0900 @@ -136,48 +136,6 @@ -DDIR=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake -P ${PROJECT_SOURCE_DIR}/cmake/gen_mkldnn_compat_cmakes.cmake)") -# MKL-DNN compat libraries -if (WIN32) - if (NOT MINGW) - set(prefix "") - set(ext "lib") - else() - set(prefix "lib") - if (DNNL_LIBRARY_TYPE STREQUAL "SHARED") - set(ext "dll.a") - else() - set(ext "a") - endif() - endif() - add_custom_target(compat_libs ALL - ${CMAKE_COMMAND} -E copy - $/${prefix}dnnl.${ext} - $/${prefix}mkldnn.${ext} - DEPENDS ${LIB_NAME}) - install(FILES $/${prefix}mkldnn.${ext} - DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) -else() - if(DNNL_LIBRARY_TYPE STREQUAL "SHARED") - set_ternary(ext APPLE ".dylib" ".so") - set(vers ".${DNNL_VERSION_MAJOR};.${DNNL_VERSION_MAJOR}.${DNNL_VERSION_MINOR}") - else() - set(ext ".a") - set(vers "") - endif() - foreach(ver "" ${vers}) - set_ternary(ext_and_ver APPLE "${ver}${ext}" "${ext}${ver}") - add_custom_command(OUTPUT libmkldnn${ext_and_ver} - # to make the next command work fine - COMMAND ${CMAKE_COMMAND} -E remove -f libmkldnn${ext_and_ver} - COMMAND ${CMAKE_COMMAND} -E create_symlink libdnnl${ext_and_ver} libmkldnn${ext_and_ver} - DEPENDS ${LIB_NAME}) - add_custom_target(compat_libs${ver} ALL - DEPENDS libmkldnn${ext_and_ver}) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmkldnn${ext_and_ver} - DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) - endforeach() -endif() - # Install custom find modules for transitive dependencies set(LIB_CONFIG_INSTALL_DIR_COMPAT "${CMAKE_INSTALL_LIBDIR}/cmake/mkldnn") if(DNNL_CPU_RUNTIME STREQUAL "TBB") diff -ruN mkl-dnn-1.2/src/cpu/cpu_engine.cpp mkl-dnn-1.2-patch/src/cpu/cpu_engine.cpp --- mkl-dnn-1.2/src/cpu/cpu_engine.cpp 2020-01-25 06:54:36.000000000 +0900 +++ mkl-dnn-1.2-patch/src/cpu/cpu_engine.cpp 2020-02-03 12:18:10.721768939 +0900 @@ -23,10 +23,29 @@ #include "cpu_stream.hpp" #include "memory.hpp" +#include "jit_uni_dw_conv_kernel_utils.hpp" + namespace dnnl { namespace impl { namespace cpu { +template struct jit_uni_dw_conv_fwd_kernel; +template struct jit_uni_dw_conv_fwd_kernel; +template struct jit_uni_dw_conv_fwd_kernel; +template struct jit_uni_dw_conv_fwd_kernel; + +template struct jit_uni_dw_conv_bwd_data_kernel; +template struct jit_uni_dw_conv_bwd_data_kernel; +template struct jit_uni_dw_conv_bwd_data_kernel; +template struct jit_uni_dw_conv_bwd_data_kernel; + +template struct jit_uni_dw_conv_bwd_weights_kernel; +template struct jit_uni_dw_conv_bwd_weights_kernel; +template struct jit_uni_dw_conv_bwd_weights_kernel; +template struct jit_uni_dw_conv_bwd_weights_kernel; + status_t cpu_engine_t::create_memory_storage( memory_storage_t **storage, unsigned flags, size_t size, void *handle) { auto _storage = new cpu_memory_storage_t(this); diff -ruN mkl-dnn-1.2/src/cpu/jit_uni_dw_conv_kernel_utils.hpp mkl-dnn-1.2-patch/src/cpu/jit_uni_dw_conv_kernel_utils.hpp --- mkl-dnn-1.2/src/cpu/jit_uni_dw_conv_kernel_utils.hpp 2020-01-25 06:54:36.000000000 +0900 +++ mkl-dnn-1.2-patch/src/cpu/jit_uni_dw_conv_kernel_utils.hpp 2020-02-03 12:05:04.333777313 +0900 @@ -192,11 +192,6 @@ scratchpad.book(key_conv_padded_bias, sizeof(float) * jcp.oc); } -template struct jit_uni_dw_conv_fwd_kernel; -template struct jit_uni_dw_conv_fwd_kernel; -template struct jit_uni_dw_conv_fwd_kernel; -template struct jit_uni_dw_conv_fwd_kernel; - template struct jit_uni_dw_conv_bwd_data_kernel { @@ -326,11 +321,6 @@ UNUSED(jcp); } -template struct jit_uni_dw_conv_bwd_data_kernel; -template struct jit_uni_dw_conv_bwd_data_kernel; -template struct jit_uni_dw_conv_bwd_data_kernel; -template struct jit_uni_dw_conv_bwd_data_kernel; - template struct jit_uni_dw_conv_bwd_weights_kernel { @@ -507,12 +497,6 @@ jcp.nthr = jcp.nthr_g * jcp.nthr_mb; } -template struct jit_uni_dw_conv_bwd_weights_kernel; -template struct jit_uni_dw_conv_bwd_weights_kernel; -template struct jit_uni_dw_conv_bwd_weights_kernel; -template struct jit_uni_dw_conv_bwd_weights_kernel; } // namespace cpu } // namespace impl } // namespace dnnl