3 ms·
I agree in general, but I'm not confident of this: > GPUs can perform 1000 binary searches faster than a CPU can perform 1000 binary searches. With several ve
by jedbrown 6y ago
I agree in general, but I'm not confident of this:
> GPUs can perform 1000 binary searches faster than a CPU can perform 1000 binary searches.
With several vector lanes and ILP on a 64+ core node, the 1000 parallel searches on the CPU may well beat the GPU. It'd have to be tested in any case.
- dragontamer 6y agoHmmmm... 1000 is still a "small" number when we're talking about GPU cores. I probably should have said 100,000 binary searches, or 1,000,000 binary searches. You're right, 1000 is a small enough number where the CPU might still win. If its a large-enough data-structure to hit VRAM (ie: a binary search across a 8GB vector), that's what'd be best for the GPU. Raytracing is millions rays per scene. 4k is 8,294,400 rays at 1-sample per pixel, and each one of those rays has to traverse a BVH tree (similar to a binary tree). Each of those rays MIGHT set off a 2nd or 3rd ray, depending on what its bouncing against. The big BVH tree that organizes all of the video game triangles / objects is shared for all rays. That's the "1000s of binary tree searches in parallel" I was trying to reference. But I guess its closer to 10s of millions.