Compilation error on KNL with -march=knl

Issue #154 resolved
khuck@cs.uoregon.edu created an issue

When compiling on KNL with the Blaze headers (using GCC 7.1 and the -march=knl flag), I get this error (and a similar error on 340):

/home/users/khuck/src/phylanx/tools/buildbot/src/blaze-head/blaze/math/simd/Reduction.h:338:103: error: invalid conversion from ‘int’ to ‘_MM_PERM_ENUM’ [-fpermissive] const __m512 f( _mm512_castsi512_ps( _mm512_shuffle_epi32( _mm512_castps_si512( e ), 0b01'00'11'10 ) ) ); ^ ... /storage/packages/gcc/7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/include/avx512fintrin.h:3864:1: note: initializing argument 2 of ‘__m512i _mm512_shuffle_epi32(__m512i, _MM_PERM_ENUM)’ _mm512_shuffle_epi32 (__m512i __A, _MM_PERM_ENUM __mask) ^~~~~~~~

Based on the enum values in the compiler headers, I think the 2nd parameter for line 338 should be _MM_PERM_BADC (for value 0x4E - aka 0b01'00'11'10) and the value on line 340 should be _MM_PERM_CDAB (for value 0xB1 - aka 0b10'11'00'01). Alternatively, casting the bit values passes compilation but using the true enum values is probably better.

Comments (5)

  1. Klaus Iglberger

    Hi!

    Thanks a lot for pointing out this problem. We have verified your suggestions and incorporated them in commit 1c3dfe8. Unfortunately we have to admit that we currently don't have access to a KNC device and therefore cannot verify whether the commit fixes the issue. Therefore we would highly appreciate if you could update to HEAD and give us feedback if the problem has been solved. Thank you very much for your help,

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Commit 1c3dfe8 fixes the AVX-512 implementation of the sum() function for single precision floating point SIMD vectors. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.3.

  3. Log in to comment