intel/x86-simd-sort

Recent changes don't compile with MSVC, cause warnings in GCC

Closed this issue · 2 comments

The additions in #61 fail to compile with MSVC. Is MSVC supported?

# using VS2022 (17.7.34031.279) ...
deps\simdsort\src\xss-network-qsort.hpp(80,11): error C2466: cannot allocate an array of constant size 0
simdsort\src\xss-network-qsort.hpp(76,9): message : see reference to function template instantiation 'void sort_n_vec<vtype,0,zmm_vector<float>::reg_t>(zmm_vector<float>::type_t *,int32_t)' b 
eing compiled
          with
          [
              vtype=vtype
          ]
simdsort\src\xss-network-qsort.hpp(76,9): message : see reference to function template instantiation 'void sort_n_vec<vtype,1,zmm_vector<float>::reg_t>(zmm_vector<float>::type_t *,int32_t)' b 
eing compiled
          with
          [
              vtype=vtype
          ]
simdsort\src\xss-network-qsort.hpp(76,9): message : see reference to function template instantiation 'void sort_n_vec<vtype,2,zmm_vector<float>::reg_t>(zmm_vector<float>::type_t *,int32_t)' b 
eing compiled
          with
          [
              vtype=vtype
          ]
simdsort\src\xss-network-qsort.hpp(76,9): message : see reference to function template instantiation 'void sort_n_vec<vtype,4,zmm_vector<float>::reg_t>(zmm_vector<float>::type_t *,int32_t)' b 
eing compiled
          with
          [
              vtype=vtype
          ]
simdsort\src\xss-network-qsort.hpp(76,9): message : see reference to function template instantiation 'void sort_n_vec<vtype,8,zmm_vector<float>::reg_t>(zmm_vector<float>::type_t *,int32_t)' b 
eing compiled
          with
          [
              vtype=vtype
          ]
simdsort\src\xss-network-qsort.hpp(134,5): message : see reference to function template instantiation 'void sort_n_vec<vtype,16,zmm_vector<float>::reg_t>(zmm_vector<float>::type_t *,int32_t)' 
 being compiled
          with
          [
              vtype=vtype
          ]
xxx.h(199,5): message : see reference to function template instantiation 'void sort_n<vtype,256>(zmm_vector<float>::type_t *,int)' being compiled
simdsort\src\xss-network-qsort.hpp(80,11): error C2133: 'vecs': unknown size
simdsort\src\xss-network-qsort.hpp(83,30): error C2466: cannot allocate an array of constant size 0
simdsort\src\xss-network-qsort.hpp(83,30): error C2133: 'ioMasks': unknown size

The changes also cause a few GCC -Wunused-but-set-parameter warnings for the regs parameter in the same file.

Thanks for reporting it. We do want to support MSVC. I think we should add a CI for windows build so that we catch these errors early. For now, could you confirm if patch #76 fixes MSVC build?

The changes also cause a few GCC -Wunused-but-set-parameter warnings for the regs parameter in the same file.

These appear to be resolved by using gcc-10/g++-10 instead of 9.

../deps/simdsort/src/xss-network-qsort.hpp: In instantiation of ‘void bitonic_fullmerge_n_vec(reg_t*) [with vtype = zmm_vector<float>; long int numVecs = 16; long int numPer = 32; reg_t = __vector(16) float]’:
../deps/simdsort/src/xss-network-qsort.hpp:68:60:   recursively required from ‘void bitonic_fullmerge_n_vec(reg_t*) [with vtype = zmm_vector<float>; long int numVecs = 16; long int numPer = 4; reg_t = __vector(16) float]’
../deps/simdsort/src/xss-network-qsort.hpp:68:60:   required from ‘void bitonic_fullmerge_n_vec(reg_t*) [with vtype = zmm_vector<float>; long int numVecs = 16; long int numPer = 2; reg_t = __vector(16) float]’
../deps/simdsort/src/xss-network-qsort.hpp:113:44:   required from ‘void sort_n_vec(typename vtype::type_t*, int32_t) [with vtype = zmm_vector<float>; int numVecs = 16; reg_t = __vector(16) float; typename vtype::type_t = float; int32_t = int]’
../deps/simdsort/src/xss-network-qsort.hpp:136:31:   required from ‘void sort_n(typename vtype::type_t*, int) [with vtype = zmm_vector<float>; long int maxN = 256; typename vtype::type_t = float]’
../src/etc/gm.h:200:55:   required from here
../deps/simdsort/src/xss-network-qsort.hpp:59:58: warning: parameter ‘regs’ set but not used [-Wunused-but-set-parameter]