I am interested in mastering prefetch-related functions such as
_mm_prefetch(...)
so when I perform operations that loop over arrays, the memory bandwidth is fully utilized. What are the best resources for learning about this?
I am doing this work in C using GCC 4 series on an intel linux platform.
There is also an excellent paper by Ulrich Drepper, What Every Programmer Should Know About Memory. He covers prefetching, plus many other topics dealing with memory performance optimization. It was released in Nov 2007, and is extremely relevant for today's processors. If you're performing operations on very large arrays and believe your bottleneck is getting to memory, you should read it.
This site contains details on gcc prefetch support including prefetch options and functions and includes details on several architectures including Intel. The gcc manual contains details on the __builtin_prefetch
built-in function in section 5.46.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With