3 ms·
I was under the impression that GPUs were mainly optimized for data-locality, while other access patterns are better left to the CPU with its sophisticated (in
by amelius 8y ago
I was under the impression that GPUs were mainly optimized for data-locality, while other access patterns are better left to the CPU with its sophisticated (in comparison) cache hierarchy. It seems this data structure is operating against this principle.
- stabbles 8y agoThe key to building fast hash maps for the cpu is to improve cache locality as well
- The_rationalist 8y agoAs a side note I believe the whole purpose of HSA is to diminish gpu data access latency by being more synchronised with the cpu. http://www.hsafoundation.com/ http://www.hsafoundation.com/
- monocasa 8y agoNo, it's to decrease manual translations between the CPU and the GPU by having the virtual memory maps match between them. Then you can just share pointers back and forth between the CPU and GPU.
- monocasa 8y agoGPUs aren't really optimized for data locality per se. They have really long pipelines to memory and are more about having as much as possible in flight at once. So under ideal conditions it doesn't matter if a memory access doesn't hit the cache and takes hundreds of clock cycles if you have hundreds of clock cycles of work on other threads to do. You can just sort of rotate through them all as results come back. What's more important is divergence, ie. being able to schedule threads that run the same way. A GPU amortizes the program counter (generally) and control logic across a bunch of threads, and if they diverge in their code flow, you end up wasting a bunch of resources on threads that are just masked off.