|
|
|
|
|
by lostmsu
1773 days ago
|
|
I like DirectX ray tracing's take on branch divergence: when a program processing a vector of rays has a branch, the vector is split into 2 subvectors by the taken branch. Then each group is rescheduled separately. The process is repeated, so the SIMD unit can be fully utilized until one of the subgroups becomes too small. I often wonder if this approach can be used for general programming. E.g. for example I could think of a C parser, that you could feed 200 files, it would use SIMD unit of width 20 to separate them into 100 files, that start with a function declaration, and 100 files, that start with a variable declaration. Then the second group would be scheduled to descent (as in recursive descent), and split into 20/80 int/bool variables. All with SIMD fully utilized. etc On the same note I am curious if it would be easy enough to write a code generator, that would use this pattern when translating regular programs. |
|