Does mixing SIMD instructions and multithreading reduce performance?

I am interested in doing a project on face recognition (using SIMD instruction set) But in the first semester of this year, I learned something about threads. I wonder if I can combine them

When should I avoid combining multithreading with SIMD instructions? When is it worth it?

Solution

Saving x87 / MMX / XMM / YMM registers may take quite a long time to be significant

Now, if there are no other threads using FP insns for an extended period of time (several or more context switches) - the lazy policy will result in failure to save / restore any FP state, and you will not be affected by performance

Since we are obviously talking about multiprocessor systems, the threads executing parallel algorithms will not conflict with each other, because they should execute on their own CPU / core / HT and have a set of private registers

TL; doctor

You should not be concerned about the overhead of saving and restoring FP registers

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>