6 karma · joined Apr 27, 2021 (5y ago) · 5 submissions
comment 5y ago · link · parent
ISPC lets you request that the gang size be larger that the vector size [1] to get 2 accumulators out of the box. If having more accumulator is crucial, you can have them at the cost of not using idiomatic ispc but I'd argue the resulting code is still more readable.
I'm no expert so they might be flaws that I don't see but the generated code looks good to me, the main difference I see is that ISPC does more unrolling (which may be better?).
Here is the reference implementation: https://godbolt.org/z/MxT1Kedf1
Here is the ISPC implementation: https://godbolt.org/z/qcez47GT5
[1] https://ispc.github.io/perfguide.html#choosing-a-target-vect...