<p dir="auto">I get the following compilation error when building pytorch 1.0.0 from source:</p>
<blockquote>
<p dir="auto">pytorch/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:223:41: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]<br>
assert(id_reg_tmp &lt; id_reg_tmp1);<br>
^</p>
</blockquote>
<p dir="auto">I worked around this issue by adding:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -Wno-strict-overflow&quot;)
set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -Wno-error=strict-overflow&quot;)"><pre class="notranslate"><code class="notranslate">set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-overflow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=strict-overflow")
</code></pre></div>
<p dir="auto">in third_party/ideep/mkl-dnn/CMakeLists.txt before adding the sub directories.<br>
But I wonder whether there are better ways to solve this error.</p>
<p dir="auto">System configuration:</p>
<p dir="auto">Ubuntu 18.04<br>
Cmake 3.12.4<br>
CUDA 9.2.148<br>
gcc g++ 6.4.0<br>
pytorch pulled from master, commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pytorch/pytorch/commit/6651fae827fb6becd177fadb35c1913ca74950de/hovercard" href="https://github.com/pytorch/pytorch/commit/6651fae827fb6becd177fadb35c1913ca74950de"><tt>6651fae</tt></a></p>
<p dir="auto">cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mingfeima/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mingfeima">@mingfeima</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp: In member function ‘void mkldnn::impl::cpu::jit_avx512_core_u8s8s32x_wino_conv_dst_trans_t::generate()’:
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^"><pre class="notranslate"><code class="notranslate">/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp: In member function ‘void mkldnn::impl::cpu::jit_avx512_core_u8s8s32x_wino_conv_dst_trans_t::generate()’:
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
/home/jaliya/repos/pytorch_clean/third_party/ideep/mkl-dnn/src/cpu/jit_avx512_core_u8s8s32x_wino_convolution.cpp:222:56: error: assuming signed overflow does not occur when assuming that (X + c) &gt;= X is always true [-Werror=strict-overflow]
         assert(id_reg_tmp &lt; jcp.alpha * jcp.alpha + 14);
                                                        ^
</code></pre></div>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/malfet/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/malfet">@malfet</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/seemethere/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/seemethere">@seemethere</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/walterddr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/walterddr">@walterddr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gujinghui/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gujinghui">@gujinghui</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/PenghuiCheng/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/PenghuiCheng">@PenghuiCheng</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/XiaobingSuper/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/XiaobingSuper">@XiaobingSuper</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jianyuh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jianyuh">@jianyuh</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/VitalyFedyunin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/VitalyFedyunin">@VitalyFedyunin</a></p>