linbox-team/fflas-ffpack

i686: failure building test-storage-transpose

tornaria opened this issue · 1 comments

I guess this is because on i686 there is no Simd128<(u)int64_t>, but I don't know how to fix it. After commenting out ok &= Test<uint64_t>(m,n).run(); and ok &= Test<int64_t>(m,n).run(); in main() the test compiles and passes.

$ make test-storage-transpose
g++ -DHAVE_CONFIG_H -I. -I..  -I..  -O2 -march=native -mfpmath=sse -Wall -DNDEBUG -UDEBUG     -g  -MT test-storage-transpose.o -MD -MP -MF .deps/test-storage-transpose.Tpo -c -o test-storage-transpose.o test-storage-transpose.C
test-storage-transpose.C: In function 'int main(int, char**)':
test-storage-transpose.C:291:35: error: no matching function for call to 'Test<long long unsigned int>::run()'
  291 |     ok &= Test<uint64_t>(m,n).run();
      |                                   ^
test-storage-transpose.C:218:10: note: candidate: 'template<class _E, Test<long long unsigned int>::enable_if_t<std::is_same<S, long long unsigned int>::value, void>* <anonymous>, Test<long long unsigned int>::enable_if_no_simd_t<E>* <anonymous> > bool Test<Elt>::run() [with _E = _E; Test<Elt>::enable_if_t<std::is_same<_E, Elt>::value>* <anonymous> = <anonymous>; Test<Elt>::enable_if_no_simd_t<_E>* <anonymous> = <anonymous>; Elt = long long unsigned int]'
  218 |     bool run () {
      |          ^~~
test-storage-transpose.C:218:10: note:   template argument deduction/substitution failed:
test-storage-transpose.C: In substitution of 'template<class Elt> template<class E> using enable_if_no_simd_t = Test<Elt>::enable_if_t<(typename SimdChooser<E, std::is_arithmetic<T>::value, std::is_integral<C>::value>::value::vect_size == 1)> [with E = long long unsigned int; Elt = long long unsigned int]':
test-storage-transpose.C:217:42:   required from here
test-storage-transpose.C:59:54: error: incomplete type 'SimdChooser<long long unsigned int, true, true>::value' {aka 'Simd256_impl<true, true, false, 8>'} used in nested name specifier
   59 |     using enable_if_no_simd_t = enable_if_t<Simd<E>::vect_size == 1>;
      |                                                      ^~~~~~~~~
test-storage-transpose.C:227:10: note: candidate: 'template<class _E, Test<long long unsigned int>::enable_if_t<std::is_same<S, long long unsigned int>::value, void>* <anonymous>, Test<long long unsigned int>::enable_if_t<(typename SimdChooser<T>::value::vect_size != 1), void>* <anonymous>, Test<long long unsigned int>::enable_if_simd128_t<E>* <anonymous> > bool Test<Elt>::run() [with _E = _E; Test<Elt>::enable_if_t<std::is_same<_E, Elt>::value>* <anonymous> = <anonymous>; Test<Elt>::enable_if_t<(typename SimdChooser<E, std::is_arithmetic<T>::value, std::is_integral<C>::value>::value::vect_size != 1)>* <anonymous> = <anonymous>; Test<Elt>::enable_if_simd128_t<_E>* <anonymous> = <anonymous>; Elt = long long unsigned int]'
  227 |     bool run () {
      |          ^~~
test-storage-transpose.C:227:10: note:   template argument deduction/substitution failed:
test-storage-transpose.C:225:47: error: incomplete type 'SimdChooser<long long unsigned int, true, true>::value' {aka 'Simd256_impl<true, true, false, 8>'} used in nested name specifier
  225 |               enable_if_t<Simd<_E>::vect_size != 1>* = nullptr,
      |                                     ~~~~~~~~~~^~~~
test-storage-transpose.C:237:10: note: candidate: 'template<class _E, Test<long long unsigned int>::enable_if_t<std::is_same<S, long long unsigned int>::value, void>* <anonymous>, Test<long long unsigned int>::enable_if_t<(typename SimdChooser<T>::value::vect_size != 1), void>* <anonymous>, Test<long long unsigned int>::enable_if_simd256_t<E>* <anonymous> > bool Test<Elt>::run() [with _E = _E; Test<Elt>::enable_if_t<std::is_same<_E, Elt>::value>* <anonymous> = <anonymous>; Test<Elt>::enable_if_t<(typename SimdChooser<E, std::is_arithmetic<T>::value, std::is_integral<C>::value>::value::vect_size != 1)>* <anonymous> = <anonymous>; Test<Elt>::enable_if_simd256_t<_E>* <anonymous> = <anonymous>; Elt = long long unsigned int]'
  237 |     bool run () {
      |          ^~~
test-storage-transpose.C:237:10: note:   template argument deduction/substitution failed:
test-storage-transpose.C:225:47: error: incomplete type 'SimdChooser<long long unsigned int, true, true>::value' {aka 'Simd256_impl<true, true, false, 8>'} used in nested name specifier
  225 |               enable_if_t<Simd<_E>::vect_size != 1>* = nullptr,
      |                                     ~~~~~~~~~~^~~~
test-storage-transpose.C:292:34: error: no matching function for call to 'Test<long long int>::run()'
  292 |     ok &= Test<int64_t>(m,n).run();
      |                                  ^
test-storage-transpose.C:218:10: note: candidate: 'template<class _E, Test<long long int>::enable_if_t<std::is_same<_E, long long int>::value, void>* <anonymous>, Test<long long int>::enable_if_no_simd_t<E>* <anonymous> > bool Test<Elt>::run() [with _E = _E; Test<Elt>::enable_if_t<std::is_same<_E, Elt>::value>* <anonymous> = <anonymous>; Test<Elt>::enable_if_no_simd_t<_E>* <anonymous> = <anonymous>; Elt = long long int]'
  218 |     bool run () {
      |          ^~~
test-storage-transpose.C:218:10: note:   template argument deduction/substitution failed:
test-storage-transpose.C: In substitution of 'template<class Elt> template<class E> using enable_if_no_simd_t = Test<Elt>::enable_if_t<(typename SimdChooser<E, std::is_arithmetic<T>::value, std::is_integral<C>::value>::value::vect_size == 1)> [with E = long long int; Elt = long long int]':
test-storage-transpose.C:217:42:   required from here
test-storage-transpose.C:59:54: error: incomplete type 'SimdChooser<long long int, true, true>::value' {aka 'Simd256_impl<true, true, true, 8>'} used in nested name specifier
   59 |     using enable_if_no_simd_t = enable_if_t<Simd<E>::vect_size == 1>;
      |                                                      ^~~~~~~~~
test-storage-transpose.C:227:10: note: candidate: 'template<class _E, Test<long long int>::enable_if_t<std::is_same<_E, long long int>::value, void>* <anonymous>, Test<long long int>::enable_if_t<(typename SimdChooser<T>::value::vect_size != 1), void>* <anonymous>, Test<long long int>::enable_if_simd128_t<E>* <anonymous> > bool Test<Elt>::run() [with _E = _E; Test<Elt>::enable_if_t<std::is_same<_E, Elt>::value>* <anonymous> = <anonymous>; Test<Elt>::enable_if_t<(typename SimdChooser<E, std::is_arithmetic<T>::value, std::is_integral<C>::value>::value::vect_size != 1)>* <anonymous> = <anonymous>; Test<Elt>::enable_if_simd128_t<_E>* <anonymous> = <anonymous>; Elt = long long int]'
  227 |     bool run () {
      |          ^~~
test-storage-transpose.C:227:10: note:   template argument deduction/substitution failed:
test-storage-transpose.C:225:47: error: incomplete type 'SimdChooser<long long int, true, true>::value' {aka 'Simd256_impl<true, true, true, 8>'} used in nested name specifier
  225 |               enable_if_t<Simd<_E>::vect_size != 1>* = nullptr,
      |                                     ~~~~~~~~~~^~~~
test-storage-transpose.C:237:10: note: candidate: 'template<class _E, Test<long long int>::enable_if_t<std::is_same<_E, long long int>::value, void>* <anonymous>, Test<long long int>::enable_if_t<(typename SimdChooser<T>::value::vect_size != 1), void>* <anonymous>, Test<long long int>::enable_if_simd256_t<E>* <anonymous> > bool Test<Elt>::run() [with _E = _E; Test<Elt>::enable_if_t<std::is_same<_E, Elt>::value>* <anonymous> = <anonymous>; Test<Elt>::enable_if_t<(typename SimdChooser<E, std::is_arithmetic<T>::value, std::is_integral<C>::value>::value::vect_size != 1)>* <anonymous> = <anonymous>; Test<Elt>::enable_if_simd256_t<_E>* <anonymous> = <anonymous>; Elt = long long int]'
  237 |     bool run () {
      |          ^~~
test-storage-transpose.C:237:10: note:   template argument deduction/substitution failed:
test-storage-transpose.C:225:47: error: incomplete type 'SimdChooser<long long int, true, true>::value' {aka 'Simd256_impl<true, true, true, 8>'} used in nested name specifier
  225 |               enable_if_t<Simd<_E>::vect_size != 1>* = nullptr,
      |                                     ~~~~~~~~~~^~~~
make: *** [Makefile:1319: test-storage-transpose.o] Error 1

The problem comes from the definition of SimdChooser for 32bit machine with AVX2:

template <class T>
struct SimdChooser<T, true, true> // integral number
{
#ifdef __FFLASFFPACK_HAVE_AVX512F_INSTRUCTIONS
using value = Simd512<T>;
#elif __FFLASFFPACK_HAVE_AVX2_INSTRUCTIONS
using value = Simd256<T>;
#elif __FFLASFFPACK_HAVE_SSE4_1_INSTRUCTIONS
using value = Simd128<T>;
#else
using value = NoSimd<T>;
#endif
};

If AVX2 is detected, then __FFLASFFPACK_HAVE_AVX2_INSTRUCTIONS is 1 and Simd<(u)int64_t> => SimdChooser<(u)int64_t, true, true>::value => Simd256<(u)int64_t>
But Simd256<(u)int64_t> is not defined for 32bit machine:
#if defined(__FFLASFFPACK_HAVE_AVX2_INSTRUCTIONS)
#ifdef __x86_64__
#include "simd256_int64.inl"
#endif
#include "simd256_int32.inl"
#include "simd256_int16.inl"
#endif

There is a similar problem with Simd128 and SSE4.

I will try to fix it and propose a PR.