google / highway

Performance-portable, length-agnostic SIMD with runtime dispatch
Apache License 2.0
3.97k stars 308 forks source link

Question: can I create an array of SIMD vectors ? #2270

Closed boxerab closed 5 days ago

boxerab commented 5 days ago

I am using dynamic dispatch for my highway code. Is it possible to declare an array of SIMD vectors, so that the type of the array is resolved dynamically ?

jan-wassenberg commented 5 days ago

Array of vector isn't possible for all targets due to RVV/SVE compiler limitations. What we instead do is to pass a pointer to lanes (not vectors) into the entry point of dynamic dispatch. Then, the dispatched code can Load() from it to whatever the vector type is. Does that make sense?

boxerab commented 5 days ago

Thanks, make sense. I will try to solve the problem with pointers to individual vectors instead.