Fix build if optional MKLDNN is not present

This commit is contained in:
Manik Jindal 2018-01-28 11:27:32 -08:00
Родитель 950ac47a0b
Коммит ba9c2e7f9d
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -947,10 +947,12 @@ protected:
bool Supported(const ConvolveGeometry* geometry, bool forward)
{
#ifdef USE_MKLDNN
//TODO: test code for linking with mkldnn.dll, will extend to support dilated convolution with MKL-DNN later
mkldnn_primitive_attr_t attr;
mkldnn_primitive_attr_create(&attr);
mkldnn_primitive_attr_destroy(attr);
#endif
//MKL2017 does not support asymmetric padding yet
if (geometry->IsAsymmetricPadding()) return false;

Просмотреть файл

@ -30,11 +30,17 @@ if "%is_gpu%" == "true" (
)
)
for %%x in (libiomp5md.dll mklml.dll mkldnn.dll Cntk.Math-%version%.dll Cntk.PerformanceProfiler-%version%.dll Cntk.Core-%version%.dll Cntk.Core.JavaBinding-%version%.dll) do (
for %%x in (libiomp5md.dll mklml.dll Cntk.Math-%version%.dll Cntk.PerformanceProfiler-%version%.dll Cntk.Core-%version%.dll Cntk.Core.JavaBinding-%version%.dll) do (
copy "%output_dir%/%%x" ".\com\microsoft\CNTK\lib\windows\%%x"
echo %%x>> .\com\microsoft\CNTK\lib\windows\NATIVE_MANIFEST
)
for %%x in (mkldnn.dll) do (
(copy "%output_dir%/%%x" ".\com\microsoft\CNTK\lib\windows\%%x") && (
echo %%x>> .\com\microsoft\CNTK\lib\windows\NATIVE_MANIFEST) || (
echo "Could not find %%x, skipping")
)
copy .\CNTKNativeUtils.java .\com\microsoft\CNTK\CNTKNativeUtils.java
"%JAVA_HOME%\bin\javac" .\com\microsoft\CNTK\*.java || (

Просмотреть файл

@ -76,7 +76,6 @@ for %%D in (
Cntk.ImageWriter-%CNTK_COMPONENT_VERSION%.dll
libiomp5md.dll
mklml.dll
mkldnn.dll
) do (
if defined CNTK_LIBRARIES (
set CNTK_LIBRARIES=!CNTK_LIBRARIES!;%CNTK_LIB_PATH%\%%D
@ -85,6 +84,11 @@ for %%D in (
)
)
@REM mkldnn.dll is optional
if exist mkldnn.dll (
set CNTK_LIBRARIES=!CNTK_LIBRARIES!;%CNTK_LIB_PATH%\mkldnn.dll
)
@REM Cntk.BinaryConvolution-%CNTK_COMPONENT_VERSION%.dll is optional
if exist Cntk.BinaryConvolution-%CNTK_COMPONENT_VERSION%.dll (
set CNTK_LIBRARIES=!CNTK_LIBRARIES!;%CNTK_LIB_PATH%\Cntk.BinaryConvolution-%CNTK_COMPONENT_VERSION%.dll