xsimd icon indicating copy to clipboard operation
xsimd copied to clipboard

Proposal for Pixi workflow

Open AntoinePrv opened this issue 1 month ago • 4 comments

This is the proposed Pixi workflow

Tasks:

  • [x] Add pixi.toml
  • [x] Add CMakePresets
  • [x] Add usage to documentation
  • [x] Add sample usage in CI

Some notes and possible improvements:

  • The CMakePresets.json is a bit verbose but I prefered to keep it modular so that we can derive all useful presets. It would be nice to make it converge with the options in CI so that it can be use there too. This is low risk since it is simply a different way to configure the same options.
  • On the CI workflow sample: along with the official setup-pixi GH action that caches dependencies, this is a very powerful way to run a lot of configurations. If the first job works well, it could also be used to run some simple gcc/clang configurations.

Close #1209

AntoinePrv avatar Nov 18 '25 12:11 AntoinePrv

@serge-sans-paille I am curious what you make of this error (with gcc-15 and -march=x86-64 -mavx2 -mno-avx512f)

sccache /home/debian/xsimd/.pixi/envs/gcc-15/bin/g++ -DXSIMD_ENABLE_XTL_COMPLEX=1 -I/home/debian/xsimd/include -isystem /home/debian/xsimd/.pixi/envs/gcc-15/include -march=x86-64 -mavx2 -mno-avx512f -Wunused-parameter -Wextra -Wreorder -std=c++17 -g -fPIC -g -fdiagnostics-color=always -MD -MT test/CMakeFiles/test_xsimd.dir/test_load_store.cpp.o -MF test/CMakeFiles/test_xsimd.dir/test_load_store.cpp.o.d -o test/CMakeFiles/test_xsimd.dir/test_load_store.cpp.o -c /home/debian/xsimd/test/test_load_store.cpp
In file included from /home/debian/xsimd/include/xsimd/types/../arch/xsimd_isa.hpp:64,
                 from /home/debian/xsimd/include/xsimd/types/xsimd_batch.hpp:528,
                 from /home/debian/xsimd/include/xsimd/xsimd.hpp:77,
                 from /home/debian/xsimd/test/test_load_store.cpp:12:
In function 'xsimd::batch<int, A> xsimd::kernel::load_masked(const int32_t*, xsimd::batch_bool_constant<int, A, Values ...>, convert<int>, Mode, requires_arch<xsimd::avx2>) [with A = xsimd::avx2; bool ...Values = {false, false, false, false, false, false, false, false}; Mode = xsimd::aligned_mode]',
    inlined from 'xsimd::batch<unsigned int, A> xsimd::kernel::load_masked(const uint32_t*, xsimd::batch_bool_constant<unsigned int, A, Values ...>, convert<unsigned int>, Mode, requires_arch<xsimd::avx2>) [with A = xsimd::avx2; bool ...Values = {false, false, false, false, false, false, false, false}; Mode = xsimd::aligned_mode]' at /home/debian/xsimd/include/xsimd/types/../arch/./xsimd_avx2.hpp:171:42:
/home/debian/xsimd/include/xsimd/types/../arch/./xsimd_avx2.hpp:163:40: error: inlining failed in call to 'always_inline' 'xsimd::batch<int, A> xsimd::kernel::load_masked(const int32_t*, xsimd::batch_bool_constant<int, A, Values ...>, convert<int>, Mode, requires_arch<xsimd::avx2>) noexcept [with A = xsimd::avx2; bool ...Values = {false, false, false, false, false, false, false, false}; Mode = xsimd::aligned_mode]': function not considered for inlining
  163 |         XSIMD_INLINE batch<int32_t, A> load_masked(int32_t const* mem, batch_bool_constant<int32_t, A, Values...> mask, convert<int32_t>, Mode, requires_arch<avx2>) noexcept
      |                                        ^~~~~~~~~~~
/home/debian/xsimd/include/xsimd/types/../arch/./xsimd_avx2.hpp:165:34: note: called from here
  165 |             return load_masked<A>(mem, mask, convert<int32_t> {}, Mode {}, avx2 {});
      |                    ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And the function in question. Could it be an infinite recursion? Or do my compilation option not make sense?

template <class A, bool... Values, class Mode>
XSIMD_INLINE batch<int32_t, A> load_masked(int32_t const* mem, batch_bool_constant<int32_t, A, Values...> mask, convert<int32_t>, Mode, requires_arch<avx2>) noexcept
{
  return load_masked<A>(mem, mask, convert<int32_t> {}, Mode {}, avx2 {});
}

This seems to start with #1162, it should work well without it.

AntoinePrv avatar Nov 18 '25 16:11 AntoinePrv

can you try https://github.com/DiamonDinoia/xsimd/tree/pixi-workflow-fix

it is not infinite recursion because of SFINAE. All of this can be greatly simplified with c++17 once available :)

DiamonDinoia avatar Nov 24 '25 17:11 DiamonDinoia

@DiamonDinoia yes runs smoothly for me: I tried clang-18, clang-21 and gcc-15 🙏

AntoinePrv avatar Nov 25 '25 09:11 AntoinePrv

@serge-sans-paille what do you think of this?

AntoinePrv avatar Nov 26 '25 09:11 AntoinePrv