Can't Compile Blaze Tests with AVX

Issue #445 resolved
Nils Deppe created an issue

Hi Klaus,

When trying to build Blaze tests with AVX support (e.g. Sandybridge) but not AVX2, I get the following compiler error:

g++ -DBLAZE_USE_XSIMD -march=sandybridge -isystem /home/nils/SpECTRE/blaze/blazetest -isystem /home/nils/SpECTRE/blaze   -c -o Char.o Char.cpp
In file included from /home/nils/SpECTRE/blaze/blaze/math/simd/Functions.h:85,
                 from /home/nils/SpECTRE/blaze/blaze/math/SIMD.h:45,
                 from /home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:89,
                 from Char.cpp:42:
/home/nils/SpECTRE/blaze/blaze/math/simd/Setall.h: In instantiation of ‘blaze::If_t<IsSigned_v<T>, blaze::SIMDint8, blaze::SIMDuint8> blaze::setall_epi8(T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T
, T, T, T) [with T = char; blaze::If_t<IsSigned_v<T>, blaze::SIMDint8, blaze::SIMDuint8> = blaze::SIMDint8]’:
/home/nils/SpECTRE/blaze/blaze/math/simd/Setall.h:157:22:   required from ‘blaze::EnableIf_t<(IsIntegral_v<T> && HasSize_v<T, 1>), typename blaze::If<IsSigned_v<T> >::Type<blaze::SIMDint8, blaze::SIMDuint8> > blaze::setall(T, Ts ...) [wit
h T = char; Ts = {}; blaze::EnableIf_t<(IsIntegral_v<T> && HasSize_v<T, 1>), typename blaze::If<IsSigned_v<T> >::Type<blaze::SIMDint8, blaze::SIMDuint8> > = blaze::SIMDint8; typename blaze::If<IsSigned_v<T> >::Type<blaze::SIMDint8, blaze:
:SIMDuint8> = blaze::SIMDint8]’
/home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:673:27:   required from ‘void blazetest::mathtest::simd::OperationTest<T>::testSetall() [with T = char]’
/home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:411:4:   required from ‘blazetest::mathtest::simd::OperationTest<T>::OperationTest() [with T = char]’
/home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:3876:4:   required from ‘void blazetest::mathtest::simd::runTest() [with T = char]’
Char.cpp:58:7:   required from here
/home/nils/SpECTRE/blaze/blaze/math/simd/Setall.h:103:10: error: no matching function for call to ‘blaze::SIMDint8::SIMDint8(__m256i)’
  103 |   return If_t<IsSigned_v<T>, SIMDint8, SIMDuint8>(
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104 |       _mm256_set_epi8(v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105 |                       v20, v19, v18, v17, v16, v15, v14, v13, v12, v11, v10, v9,
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                       v8, v7, v6, v5, v4, v3, v2, v1, v0));
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/nils/SpECTRE/blaze/blaze/math/SIMD.h:43,
                 from /home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:89,
                 from Char.cpp:42:
/home/nils/SpECTRE/blaze/blaze/math/simd/BasicTypes.h:115:24: note: candidate: ‘template<class T> blaze::SIMDint8::SIMDint8(const blaze::SIMDi8<T>&)’
  115 |    BLAZE_ALWAYS_INLINE SIMDint8( const SIMDi8<T>& v ) noexcept : value( (*v).value ) {}
      |                        ^~~~~~~~
/home/nils/SpECTRE/blaze/blaze/math/simd/BasicTypes.h:115:24: note:   template argument deduction/substitution failed:
In file included from /home/nils/SpECTRE/blaze/blaze/math/simd/Functions.h:85,
                 from /home/nils/SpECTRE/blaze/blaze/math/SIMD.h:45,
                 from /home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:89,
                 from Char.cpp:42:
/home/nils/SpECTRE/blaze/blaze/math/simd/Setall.h:103:10: note:   mismatched types ‘const blaze::SIMDi8<T>’ and ‘__m256i’
  103 |   return If_t<IsSigned_v<T>, SIMDint8, SIMDuint8>(
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104 |       _mm256_set_epi8(v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105 |                       v20, v19, v18, v17, v16, v15, v14, v13, v12, v11, v10, v9,
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                       v8, v7, v6, v5, v4, v3, v2, v1, v0));
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/nils/SpECTRE/blaze/blaze/math/SIMD.h:43,
                 from /home/nils/SpECTRE/blaze/blazetest/blazetest/mathtest/simd/OperationTest.h:89,
                 from Char.cpp:42:
/home/nils/SpECTRE/blaze/blaze/math/simd/BasicTypes.h:112:24: note: candidate: ‘blaze::SIMDint8::SIMDint8(blaze::SIMDint8::IntrinsicType)’
  112 |    BLAZE_ALWAYS_INLINE SIMDint8( IntrinsicType v ) noexcept : value( v ) {}
      |                        ^~~~~~~~
/home/nils/SpECTRE/blaze/blaze/math/simd/BasicTypes.h:112:48: note:   no known conversion for argument 1 from ‘__m256i’ to ‘blaze::SIMDint8::IntrinsicType’
  112 |    BLAZE_ALWAYS_INLINE SIMDint8( IntrinsicType v ) noexcept : value( v ) {}

Switching SIMDint8 to mm256i in AVX mode breaks some other pieces of code, like abs. I’m not sure what you think the right path forward is. To reproduce you should be able to just set -march=sandybridge in blaze/blazetest/ConfigeFile.

Best,

Nils

Comments (3)

  1. Klaus Iglberger

    Hi Nils!

    Thanks a lot for reporting this defect. I’ll take a look and try to find a fix as quickly as possible.

    Best regards,

    Klaus!

  2. Nils Deppe reporter

    Hi Klaus!

    Great, thank you! This isn’t a blocking issue for us, just something I noticed :)

    Best,

    Nils

  3. Klaus Iglberger

    Commit e8bad54 fixes the compilation issues for integral types when using AVX. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9.

  4. Log in to comment