x86-simd-sort icon indicating copy to clipboard operation
x86-simd-sort copied to clipboard

Try to get better type errors for the static sorting functions

Open sterrettm2 opened this issue 6 months ago • 0 comments

This patch tries to make type errors better when building with the static functions. It should hopefully make it more clear when the typing is an issue.

Here is a comparison between before and after error messages for GCC with a simple test program that tries to sort int16_t values. This is built with only AVX2 enabled, so int16_t sorting is not available.

GCC Before
In file included from ../x86-simd-sort/src/xss-pivot-selection.hpp:5,
                 from ../x86-simd-sort/src/xss-common-qsort.h:37,
                 from ../x86-simd-sort/src/x86simdsort-static-incl.h:155,
                 from main.cpp:2:
../x86-simd-sort/src/xss-common-comparators.hpp: In instantiation of ‘struct Comparator<avx2_vector<short int>, true>’:
../x86-simd-sort/src/xss-common-qsort.h:540:60:   required from ‘void qsort_(type_t*, arrsize_t, arrsize_t, arrsize_t, arrsize_t) [with vtype = avx2_vector<short int>; comparator = Comparator<avx2_vector<short int>, true>; type_t = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/xss-common-qsort.h:701:37:   required from ‘void xss_qsort(T*, arrsize_t, bool) [with vtype = avx2_vector<short int>; T = short int; bool descending = true; arrsize_t = long unsigned int]’
../x86-simd-sort/src/xss-common-qsort.h:806:1:   required from ‘void avx2_qsort(T*, arrsize_t, bool, bool) [with T = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/x86simdsort-static-incl.h:208:1:   required from ‘void x86simdsortStatic::qsort(T*, size_t, bool, bool) [with T = short int; size_t = long unsigned int]’
main.cpp:15:29:   required from here
../x86-simd-sort/src/xss-common-comparators.hpp:39:11: error: invalid use of incomplete type ‘struct avx2_vector<short int>’
   39 |     using reg_t = typename vtype::reg_t;
      |           ^~~~~
In file included from ../x86-simd-sort/src/x86simdsort-static-incl.h:5:
../x86-simd-sort/src/xss-common-includes.h:102:8: note: declaration of ‘struct avx2_vector<short int>’
  102 | struct avx2_vector;
      |        ^~~~~~~~~~~
../x86-simd-sort/src/xss-common-comparators.hpp:40:11: error: invalid use of incomplete type ‘struct avx2_vector<short int>’
   40 |     using opmask_t = typename vtype::opmask_t;
      |           ^~~~~~~~
../x86-simd-sort/src/xss-common-includes.h:102:8: note: declaration of ‘struct avx2_vector<short int>’
  102 | struct avx2_vector;
      |        ^~~~~~~~~~~
../x86-simd-sort/src/xss-common-comparators.hpp:41:11: error: invalid use of incomplete type ‘struct avx2_vector<short int>’
   41 |     using type_t = typename vtype::type_t;
      |           ^~~~~~
../x86-simd-sort/src/xss-common-includes.h:102:8: note: declaration of ‘struct avx2_vector<short int>’
  102 | struct avx2_vector;
      |        ^~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h: In instantiation of ‘void qsort_(type_t*, arrsize_t, arrsize_t, arrsize_t, arrsize_t) [with vtype = avx2_vector<short int>; comparator = Comparator<avx2_vector<short int>, true>; type_t = short int; arrsize_t = long unsigned int]’:
../x86-simd-sort/src/xss-common-qsort.h:701:37:   required from ‘void xss_qsort(T*, arrsize_t, bool) [with vtype = avx2_vector<short int>; T = short int; bool descending = true; arrsize_t = long unsigned int]’
../x86-simd-sort/src/xss-common-qsort.h:806:1:   required from ‘void avx2_qsort(T*, arrsize_t, bool, bool) [with T = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/x86simdsort-static-incl.h:208:1:   required from ‘void x86simdsortStatic::qsort(T*, size_t, bool, bool) [with T = short int; size_t = long unsigned int]’
main.cpp:15:29:   required from here
../x86-simd-sort/src/xss-common-qsort.h:540:60: error: ‘STDSortComparator’ is not a member of ‘Comparator<avx2_vector<short int>, true>’
  540 |         std::sort(arr + left, arr + right + 1, comparator::STDSortComparator);
      |                                                            ^~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:546:36: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  546 |     if (right + 1 - left <= vtype::network_sort_threshold) {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:547:42: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  547 |         sort_n<vtype, comparator, vtype::network_sort_threshold>(
      |                                          ^~~~~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:558:38: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  558 |     type_t smallest = vtype::type_max();
      |                       ~~~~~~~~~~~~~~~^~
../x86-simd-sort/src/xss-common-qsort.h:559:37: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  559 |     type_t biggest = vtype::type_min();
      |                      ~~~~~~~~~~~~~~~^~
../x86-simd-sort/src/xss-common-qsort.h:563:55: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  563 |                                                vtype::partition_unroll_factor>(
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:568:48: error: ‘leftmost’ is not a member of ‘Comparator<avx2_vector<short int>, true>’
  568 |     type_t leftmostValue = comparator::leftmost(smallest, biggest);
      |                            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:569:50: error: ‘rightmost’ is not a member of ‘Comparator<avx2_vector<short int>, true>’
  569 |     type_t rightmostValue = comparator::rightmost(smallest, biggest);
      |                             ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-comparators.hpp: In instantiation of ‘struct Comparator<avx2_vector<short int>, false>’:
../x86-simd-sort/src/xss-common-qsort.h:540:60:   required from ‘void qsort_(type_t*, arrsize_t, arrsize_t, arrsize_t, arrsize_t) [with vtype = avx2_vector<short int>; comparator = Comparator<avx2_vector<short int>, false>; type_t = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/xss-common-qsort.h:701:37:   required from ‘void xss_qsort(T*, arrsize_t, bool) [with vtype = avx2_vector<short int>; T = short int; bool descending = false; arrsize_t = long unsigned int]’
../x86-simd-sort/src/xss-common-qsort.h:806:1:   required from ‘void avx2_qsort(T*, arrsize_t, bool, bool) [with T = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/x86simdsort-static-incl.h:208:1:   required from ‘void x86simdsortStatic::qsort(T*, size_t, bool, bool) [with T = short int; size_t = long unsigned int]’
main.cpp:15:29:   required from here
../x86-simd-sort/src/xss-common-comparators.hpp:39:11: error: invalid use of incomplete type ‘struct avx2_vector<short int>’
   39 |     using reg_t = typename vtype::reg_t;
      |           ^~~~~
../x86-simd-sort/src/xss-common-includes.h:102:8: note: declaration of ‘struct avx2_vector<short int>’
  102 | struct avx2_vector;
      |        ^~~~~~~~~~~
../x86-simd-sort/src/xss-common-comparators.hpp:40:11: error: invalid use of incomplete type ‘struct avx2_vector<short int>’
   40 |     using opmask_t = typename vtype::opmask_t;
      |           ^~~~~~~~
../x86-simd-sort/src/xss-common-includes.h:102:8: note: declaration of ‘struct avx2_vector<short int>’
  102 | struct avx2_vector;
      |        ^~~~~~~~~~~
../x86-simd-sort/src/xss-common-comparators.hpp:41:11: error: invalid use of incomplete type ‘struct avx2_vector<short int>’
   41 |     using type_t = typename vtype::type_t;
      |           ^~~~~~
../x86-simd-sort/src/xss-common-includes.h:102:8: note: declaration of ‘struct avx2_vector<short int>’
  102 | struct avx2_vector;
      |        ^~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h: In instantiation of ‘void qsort_(type_t*, arrsize_t, arrsize_t, arrsize_t, arrsize_t) [with vtype = avx2_vector<short int>; comparator = Comparator<avx2_vector<short int>, false>; type_t = short int; arrsize_t = long unsigned int]’:
../x86-simd-sort/src/xss-common-qsort.h:701:37:   required from ‘void xss_qsort(T*, arrsize_t, bool) [with vtype = avx2_vector<short int>; T = short int; bool descending = false; arrsize_t = long unsigned int]’
../x86-simd-sort/src/xss-common-qsort.h:806:1:   required from ‘void avx2_qsort(T*, arrsize_t, bool, bool) [with T = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/x86simdsort-static-incl.h:208:1:   required from ‘void x86simdsortStatic::qsort(T*, size_t, bool, bool) [with T = short int; size_t = long unsigned int]’
main.cpp:15:29:   required from here
../x86-simd-sort/src/xss-common-qsort.h:540:60: error: ‘STDSortComparator’ is not a member of ‘Comparator<avx2_vector<short int>, false>’
  540 |         std::sort(arr + left, arr + right + 1, comparator::STDSortComparator);
      |                                                            ^~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:546:36: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  546 |     if (right + 1 - left <= vtype::network_sort_threshold) {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:547:42: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  547 |         sort_n<vtype, comparator, vtype::network_sort_threshold>(
      |                                          ^~~~~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:558:38: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  558 |     type_t smallest = vtype::type_max();
      |                       ~~~~~~~~~~~~~~~^~
../x86-simd-sort/src/xss-common-qsort.h:559:37: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  559 |     type_t biggest = vtype::type_min();
      |                      ~~~~~~~~~~~~~~~^~
../x86-simd-sort/src/xss-common-qsort.h:563:55: error: incomplete type ‘avx2_vector<short int>’ used in nested name specifier
  563 |                                                vtype::partition_unroll_factor>(
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:568:48: error: ‘leftmost’ is not a member of ‘Comparator<avx2_vector<short int>, false>’
  568 |     type_t leftmostValue = comparator::leftmost(smallest, biggest);
      |                            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
../x86-simd-sort/src/xss-common-qsort.h:569:50: error: ‘rightmost’ is not a member of ‘Comparator<avx2_vector<short int>, false>’
  569 |     type_t rightmostValue = comparator::rightmost(smallest, biggest);
      |                             ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

GCC After
In file included from ../x86-simd-sort/src/x86simdsort-static-incl.h:155,
                 from main.cpp:2:
../x86-simd-sort/src/xss-common-qsort.h: In instantiation of ‘void xss_qsort(T*, arrsize_t, bool) [with vtype = avx2_vector<short int>; T = short int; bool descending = true; arrsize_t = long unsigned int]’:
../x86-simd-sort/src/xss-common-qsort.h:810:1:   required from ‘void avx2_qsort(T*, arrsize_t, bool, bool) [with T = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/x86simdsort-static-incl.h:208:1:   required from ‘void x86simdsortStatic::qsort(T*, size_t, bool, bool) [with T = short int; size_t = long unsigned int]’
main.cpp:15:29:   required from here
../x86-simd-sort/src/xss-common-qsort.h:655:46: error: static assertion failed: Invalid type for qsort!
  655 |     static_assert(is_valid_vector_type<vtype>(), "Invalid type for qsort!");
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
../x86-simd-sort/src/xss-common-qsort.h:655:46: note: ‘is_valid_vector_type<avx2_vector<short int> >()’ evaluates to false
../x86-simd-sort/src/xss-common-qsort.h: In instantiation of ‘void xss_qsort(T*, arrsize_t, bool) [with vtype = avx2_vector<short int>; T = short int; bool descending = false; arrsize_t = long unsigned int]’:
../x86-simd-sort/src/xss-common-qsort.h:810:1:   required from ‘void avx2_qsort(T*, arrsize_t, bool, bool) [with T = short int; arrsize_t = long unsigned int]’
../x86-simd-sort/src/x86simdsort-static-incl.h:208:1:   required from ‘void x86simdsortStatic::qsort(T*, size_t, bool, bool) [with T = short int; size_t = long unsigned int]’
main.cpp:15:29:   required from here
../x86-simd-sort/src/xss-common-qsort.h:655:46: error: static assertion failed: Invalid type for qsort!
../x86-simd-sort/src/xss-common-qsort.h:655:46: note: ‘is_valid_vector_type<avx2_vector<short int> >()’ evaluates to false

Unfortunately, it doesn't work nearly as well for Clang:

Clang Before
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:39:28: error: implicit instantiation of undefined template 'avx2_vector<short>'
   39 |     using reg_t = typename vtype::reg_t;
      |                            ^
./../x86-simd-sort/src/xss-common-qsort.h:540:48: note: in instantiation of template class 'Comparator<avx2_vector<short>, true>' requested here
  540 |         std::sort(arr + left, arr + right + 1, comparator::STDSortComparator);
      |                                                ^
./../x86-simd-sort/src/xss-common-qsort.h:701:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  701 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:806:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  806 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:773:27: note: expanded from macro 'DEFINE_METHODS'
  773 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:164:1: note: expanded from here
  164 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:40:31: error: implicit instantiation of undefined template 'avx2_vector<short>'
   40 |     using opmask_t = typename vtype::opmask_t;
      |                               ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:41:29: error: implicit instantiation of undefined template 'avx2_vector<short>'
   41 |     using type_t = typename vtype::type_t;
      |                             ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:546:29: error: implicit instantiation of undefined template 'avx2_vector<short>'
  546 |     if (right + 1 - left <= vtype::network_sort_threshold) {
      |                             ^
./../x86-simd-sort/src/xss-common-qsort.h:701:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  701 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:806:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  806 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:773:27: note: expanded from macro 'DEFINE_METHODS'
  773 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:164:1: note: expanded from here
  164 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:558:23: error: implicit instantiation of undefined template 'avx2_vector<short>'
  558 |     type_t smallest = vtype::type_max();
      |                       ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:559:22: error: implicit instantiation of undefined template 'avx2_vector<short>'
  559 |     type_t biggest = vtype::type_min();
      |                      ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:563:48: error: implicit instantiation of undefined template 'avx2_vector<short>'
  563 |                                                vtype::partition_unroll_factor>(
      |                                                ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:98:28: error: implicit instantiation of undefined template 'avx2_vector<short>'
   98 |     using reg_t = typename vtype::reg_t;
      |                            ^
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:701:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  701 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:806:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  806 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:773:27: note: expanded from macro 'DEFINE_METHODS'
  773 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:164:1: note: expanded from here
  164 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:101:43: error: implicit instantiation of undefined template 'avx2_vector<short>'
  101 |     if (right - left + 1 <= 4 * numVecs * vtype::numlanes) {
      |                                           ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:105:33: error: implicit instantiation of undefined template 'avx2_vector<short>'
  105 |     constexpr int N = numVecs * vtype::numlanes;
      |                                 ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:107:32: error: implicit instantiation of undefined template 'avx2_vector<short>'
  107 |     arrsize_t width = (right - vtype::numlanes) - left;
      |                                ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:112:19: error: implicit instantiation of undefined template 'avx2_vector<short>'
  112 |         vecs[i] = vtype::loadu(arr + left + delta * i);
      |                   ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:122:9: error: implicit instantiation of undefined template 'avx2_vector<short>'
  122 |         vtype::storeu(samples + vtype::numlanes * i, vecs[i]);
      |         ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:39:28: error: implicit instantiation of undefined template 'avx2_vector<short>'
   39 |     using reg_t = typename vtype::reg_t;
      |                            ^
./../x86-simd-sort/src/xss-optimal-networks.hpp:9:5: note: in instantiation of template class 'Comparator<avx2_vector<short>, false>' requested here
    9 |     comparator::COEX(vecs[0], vecs[2]);
      |     ^
./../x86-simd-sort/src/xss-network-qsort.hpp:23:9: note: in instantiation of function template specialization 'optimal_sort_4<avx2_vector<short>, Comparator<avx2_vector<short>, false>, int>' requested here
   23 |         optimal_sort_4<vtype, comparator>(regs);
      |         ^
./../x86-simd-sort/src/xss-network-qsort.hpp:165:5: note: in instantiation of function template specialization 'bitonic_sort_n_vec<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  165 |     bitonic_sort_n_vec<vtype, comparator, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-pivot-selection.hpp:118:5: note: in instantiation of function template specialization 'sort_vectors<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  118 |     sort_vectors<vtype, Comparator<vtype, false>, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:701:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  701 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:806:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  806 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:773:27: note: expanded from macro 'DEFINE_METHODS'
  773 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:164:1: note: expanded from here
  164 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:40:31: error: implicit instantiation of undefined template 'avx2_vector<short>'
   40 |     using opmask_t = typename vtype::opmask_t;
      |                               ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:41:29: error: implicit instantiation of undefined template 'avx2_vector<short>'
   41 |     using type_t = typename vtype::type_t;
      |                             ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:195:9: error: implicit instantiation of undefined template 'avx2_vector<short>'
  195 |     a = vtype::min(a, b);
      |         ^
./../x86-simd-sort/src/xss-common-comparators.hpp:64:15: note: in instantiation of function template specialization 'COEX<avx2_vector<short>, int>' requested here
   64 |             ::COEX<vtype, reg_t>(a, b);
      |               ^
./../x86-simd-sort/src/xss-optimal-networks.hpp:10:17: note: in instantiation of member function 'Comparator<avx2_vector<short>, false>::COEX' requested here
   10 |     comparator::COEX(vecs[1], vecs[3]);
      |                 ^
./../x86-simd-sort/src/xss-network-qsort.hpp:23:9: note: in instantiation of function template specialization 'optimal_sort_4<avx2_vector<short>, Comparator<avx2_vector<short>, false>, int>' requested here
   23 |         optimal_sort_4<vtype, comparator>(regs);
      |         ^
./../x86-simd-sort/src/xss-network-qsort.hpp:165:5: note: in instantiation of function template specialization 'bitonic_sort_n_vec<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  165 |     bitonic_sort_n_vec<vtype, comparator, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-pivot-selection.hpp:118:5: note: in instantiation of function template specialization 'sort_vectors<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  118 |     sort_vectors<vtype, Comparator<vtype, false>, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:701:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  701 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:806:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  806 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:773:27: note: expanded from macro 'DEFINE_METHODS'
  773 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:164:1: note: expanded from here
  164 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:196:9: error: implicit instantiation of undefined template 'avx2_vector<short>'
  196 |     b = vtype::max(temp, b);
      |         ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:4:
./../x86-simd-sort/src/xss-network-qsort.hpp:146:28: error: implicit instantiation of undefined template 'avx2_vector<short>'
  146 |     if constexpr (numPer > vtype::numlanes) {
      |                            ^
./../x86-simd-sort/src/xss-network-qsort.hpp:168:5: note: in instantiation of function template specialization 'merge_n_vec<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, 2, int>' requested here
  168 |     merge_n_vec<vtype, comparator, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-pivot-selection.hpp:118:5: note: in instantiation of function template specialization 'sort_vectors<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  118 |     sort_vectors<vtype, Comparator<vtype, false>, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:701:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  701 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:806:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  806 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:773:27: note: expanded from macro 'DEFINE_METHODS'
  773 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:164:1: note: expanded from here
  164 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
./../x86-simd-sort/src/xss-common-includes.h:102:8: note: template is declared here
  102 | struct avx2_vector;
      |        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Clang After
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:655:19: error: static assertion failed due to requirement 'is_valid_vector_type<avx2_vector<short>>()': Invalid type for qsort!
  655 |     static_assert(is_valid_vector_type<vtype>(), "Invalid type for qsort!");
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./../x86-simd-sort/src/xss-common-qsort.h:810:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  810 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:777:27: note: expanded from macro 'DEFINE_METHODS'
  777 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:166:1: note: expanded from here
  166 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:39:35: error: no type named 'reg_t' in 'avx2_vector<short>'
   39 |     using reg_t = typename vtype::reg_t;
      |                   ~~~~~~~~~~~~~~~~^~~~~
./../x86-simd-sort/src/xss-common-qsort.h:540:48: note: in instantiation of template class 'Comparator<avx2_vector<short>, true>' requested here
  540 |         std::sort(arr + left, arr + right + 1, comparator::STDSortComparator);
      |                                                ^
./../x86-simd-sort/src/xss-common-qsort.h:702:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  702 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:810:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  810 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:777:27: note: expanded from macro 'DEFINE_METHODS'
  777 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:166:1: note: expanded from here
  166 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:40:38: error: no type named 'opmask_t' in 'avx2_vector<short>'
   40 |     using opmask_t = typename vtype::opmask_t;
      |                      ~~~~~~~~~~~~~~~~^~~~~~~~
./../x86-simd-sort/src/xss-common-comparators.hpp:41:36: error: no type named 'type_t' in 'avx2_vector<short>'
   41 |     using type_t = typename vtype::type_t;
      |                    ~~~~~~~~~~~~~~~~^~~~~~
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:546:36: error: no member named 'network_sort_threshold' in 'avx2_vector<short>'
  546 |     if (right + 1 - left <= vtype::network_sort_threshold) {
      |                             ~~~~~~~^
./../x86-simd-sort/src/xss-common-qsort.h:702:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  702 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:810:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  810 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:777:27: note: expanded from macro 'DEFINE_METHODS'
  777 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:166:1: note: expanded from here
  166 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:558:30: error: no member named 'type_max' in 'avx2_vector<short>'
  558 |     type_t smallest = vtype::type_max();
      |                       ~~~~~~~^
./../x86-simd-sort/src/xss-common-qsort.h:559:29: error: no member named 'type_min' in 'avx2_vector<short>'
  559 |     type_t biggest = vtype::type_min();
      |                      ~~~~~~~^
./../x86-simd-sort/src/xss-common-qsort.h:563:55: error: no member named 'partition_unroll_factor' in 'avx2_vector<short>'
  563 |                                                vtype::partition_unroll_factor>(
      |                                                ~~~~~~~^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:98:35: error: no type named 'reg_t' in 'avx2_vector<short>'
   98 |     using reg_t = typename vtype::reg_t;
      |                   ~~~~~~~~~~~~~~~~^~~~~
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:702:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  702 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:810:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  810 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:777:27: note: expanded from macro 'DEFINE_METHODS'
  777 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:166:1: note: expanded from here
  166 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
./../x86-simd-sort/src/xss-pivot-selection.hpp:101:50: error: no member named 'numlanes' in 'avx2_vector<short>'
  101 |     if (right - left + 1 <= 4 * numVecs * vtype::numlanes) {
      |                                           ~~~~~~~^
./../x86-simd-sort/src/xss-pivot-selection.hpp:105:40: error: no member named 'numlanes' in 'avx2_vector<short>'
  105 |     constexpr int N = numVecs * vtype::numlanes;
      |                                 ~~~~~~~^
./../x86-simd-sort/src/xss-pivot-selection.hpp:107:39: error: no member named 'numlanes' in 'avx2_vector<short>'
  107 |     arrsize_t width = (right - vtype::numlanes) - left;
      |                                ~~~~~~~^
./../x86-simd-sort/src/xss-pivot-selection.hpp:112:26: error: no member named 'loadu' in 'avx2_vector<short>'
  112 |         vecs[i] = vtype::loadu(arr + left + delta * i);
      |                   ~~~~~~~^
./../x86-simd-sort/src/xss-pivot-selection.hpp:122:16: error: no member named 'storeu' in 'avx2_vector<short>'
  122 |         vtype::storeu(samples + vtype::numlanes * i, vecs[i]);
      |         ~~~~~~~^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:39:35: error: no type named 'reg_t' in 'avx2_vector<short>'
   39 |     using reg_t = typename vtype::reg_t;
      |                   ~~~~~~~~~~~~~~~~^~~~~
./../x86-simd-sort/src/xss-optimal-networks.hpp:9:5: note: in instantiation of template class 'Comparator<avx2_vector<short>, false>' requested here
    9 |     comparator::COEX(vecs[0], vecs[2]);
      |     ^
./../x86-simd-sort/src/xss-network-qsort.hpp:23:9: note: in instantiation of function template specialization 'optimal_sort_4<avx2_vector<short>, Comparator<avx2_vector<short>, false>, int>' requested here
   23 |         optimal_sort_4<vtype, comparator>(regs);
      |         ^
./../x86-simd-sort/src/xss-network-qsort.hpp:165:5: note: in instantiation of function template specialization 'bitonic_sort_n_vec<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  165 |     bitonic_sort_n_vec<vtype, comparator, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-pivot-selection.hpp:118:5: note: in instantiation of function template specialization 'sort_vectors<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  118 |     sort_vectors<vtype, Comparator<vtype, false>, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:702:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  702 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:810:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  810 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:777:27: note: expanded from macro 'DEFINE_METHODS'
  777 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:166:1: note: expanded from here
  166 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
In file included from ./../x86-simd-sort/src/xss-common-qsort.h:37:
In file included from ./../x86-simd-sort/src/xss-pivot-selection.hpp:5:
./../x86-simd-sort/src/xss-common-comparators.hpp:40:38: error: no type named 'opmask_t' in 'avx2_vector<short>'
   40 |     using opmask_t = typename vtype::opmask_t;
      |                      ~~~~~~~~~~~~~~~~^~~~~~~~
./../x86-simd-sort/src/xss-common-comparators.hpp:41:36: error: no type named 'type_t' in 'avx2_vector<short>'
   41 |     using type_t = typename vtype::type_t;
      |                    ~~~~~~~~~~~~~~~~^~~~~~
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:195:16: error: no member named 'min' in 'avx2_vector<short>'
  195 |     a = vtype::min(a, b);
      |         ~~~~~~~^
./../x86-simd-sort/src/xss-common-comparators.hpp:64:15: note: in instantiation of function template specialization 'COEX<avx2_vector<short>, int>' requested here
   64 |             ::COEX<vtype, reg_t>(a, b);
      |               ^
./../x86-simd-sort/src/xss-optimal-networks.hpp:10:17: note: in instantiation of member function 'Comparator<avx2_vector<short>, false>::COEX' requested here
   10 |     comparator::COEX(vecs[1], vecs[3]);
      |                 ^
./../x86-simd-sort/src/xss-network-qsort.hpp:23:9: note: in instantiation of function template specialization 'optimal_sort_4<avx2_vector<short>, Comparator<avx2_vector<short>, false>, int>' requested here
   23 |         optimal_sort_4<vtype, comparator>(regs);
      |         ^
./../x86-simd-sort/src/xss-network-qsort.hpp:165:5: note: in instantiation of function template specialization 'bitonic_sort_n_vec<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  165 |     bitonic_sort_n_vec<vtype, comparator, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-pivot-selection.hpp:118:5: note: in instantiation of function template specialization 'sort_vectors<avx2_vector<short>, Comparator<avx2_vector<short>, false>, 4, int>' requested here
  118 |     sort_vectors<vtype, Comparator<vtype, false>, numVecs>(vecs);
      |     ^
./../x86-simd-sort/src/xss-common-qsort.h:553:15: note: in instantiation of function template specialization 'get_pivot_smart<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  553 |             = get_pivot_smart<vtype, comparator, type_t>(arr, left, right);
      |               ^
./../x86-simd-sort/src/xss-common-qsort.h:702:9: note: in instantiation of function template specialization 'qsort_<avx2_vector<short>, Comparator<avx2_vector<short>, true>, short>' requested here
  702 |         qsort_<vtype, comparator, T>(
      |         ^
./../x86-simd-sort/src/xss-common-qsort.h:810:1: note: in instantiation of function template specialization 'xss_qsort<avx2_vector<short>, short, true>' requested here
  810 | DEFINE_METHODS(avx2, avx2_vector<T>)
      | ^
./../x86-simd-sort/src/xss-common-qsort.h:777:27: note: expanded from macro 'DEFINE_METHODS'
  777 |         if (descending) { xss_qsort<VTYPE, T, true>(arr, size, hasnan); } \
      |                           ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:208:1: note: in instantiation of function template specialization 'avx2_qsort<short>' requested here
  208 | XSS_METHODS(avx2)
      | ^
./../x86-simd-sort/src/x86simdsort-static-incl.h:78:9: note: expanded from macro 'XSS_METHODS'
   78 |         ISA##_qsort(arr, size, hasnan, descending); \
      |         ^
<scratch space>:166:1: note: expanded from here
  166 | avx2_qsort
      | ^
main.cpp:15:24: note: in instantiation of function template specialization 'x86simdsortStatic::qsort<short>' requested here
   15 |     x86simdsortStatic::qsort(arr.data(), 34, ARRSIZE);
      |                        ^
In file included from main.cpp:2:
In file included from ./../x86-simd-sort/src/x86simdsort-static-incl.h:155:
./../x86-simd-sort/src/xss-common-qsort.h:196:16: error: no member named 'max' in 'avx2_vector<short>'
  196 |     b = vtype::max(temp, b);
      |         ~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

I'm not so sure about the description for the error messages, so I'd be glad to get feedback on that.

sterrettm2 avatar May 09 '25 23:05 sterrettm2