xsimd icon indicating copy to clipboard operation
xsimd copied to clipboard

store_aligned second parameter should be batch<T, N> not simd_type

Open wolfv opened this issue 6 years ago • 5 comments

In order to call store_aligned / unaligned in a generic fashion we should make the second parameter also aware of the batch size not being the max batch size (e.g. storing a SSE batch with this function when AVX is available doesn't work right now).

wolfv avatar Dec 13 '18 09:12 wolfv

Hi, is there some kind of workaround for this issue? I must admit this is quite inconvenient in my case, where I want to manage batches of size 4 with an AVX compilation.

thx

blackccpie avatar Mar 06 '19 15:03 blackccpie

Yes, definitely, you can always call the store aligned member function of the batch!

float* ptr;
xsimd::batch<float, 4> a(0, 1, 2, 3);
a.store_aligned(ptr);
...

wolfv avatar Mar 06 '19 15:03 wolfv

@wolfv : thanks, that did the trick indeed :-)

blackccpie avatar Mar 06 '19 16:03 blackccpie

Good to hear. If you want to contribute and open a PR that implements this for the free functions, that would be very appreciated :)

wolfv avatar Mar 07 '19 09:03 wolfv

@wolfv : Contributing to xsimd would be great, but for now I haven't got enough bandwidth. Anyway I keep the idea in my mind ;-) Another feature I would be interested in is having shuffle/permutation capabilities in xsimd.

blackccpie avatar Mar 15 '19 10:03 blackccpie

We now have a free function for loading / storing, and the simd_type / batch type distinction doesn't exist anymore → closing.

serge-sans-paille avatar Dec 13 '22 20:12 serge-sans-paille