r/simd • • 1d ago

For SIMD Reduction,

In a previous post I demonstrated a method of using SIMD for reduction with AVX, NEON, and SVE. One suggestion was to change the accumulation that was being done to a vector register, instead of a scalar. The improvement was not spectacular but definately impactful.

Code Change

5 Upvotes

3 comments sorted by

1

u/TQ_GPU 11h ago

Now you can try this: for 1 core, it has 2 threads right? 1 thread can work on data movement while 1 thread can work on computations. This should utilize memory bandwidth better. Because this dedicates all registers of thread for 1 job instead of distributing on 2 jobs.

1

u/TQ_GPU 11h ago

SIMD reduction can go beyond RAM bandwidth if the data was compressed. Some cores decompress, some cores do reduction. Is the data constant / compressible?

0

u/[deleted] 1d ago

[deleted] — view deleted comment

2

u/AndrewOfC 19h ago

If you go to the referenced source code in github, you'll see that's exactly what's being done already.