You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The integration header and OpenCL generation code has evolved over time to become convoluted and difficult to maintain. It doesn't properly handle the recursive nature of types in many cases as it seems to do so on a mostly ad-hoc basis. It also has a fairly sizable use of recursive lambdas that are both difficult to read and painful to modify. The variety of checks and processings are unfortunately mixed to the point where it is difficult to follow the path through the code.
This patch replaces the existing implementation with a series of visitor types and infrastructure with which to properly iterate and recurse through the kernel lambda objects. It also better splits up the responsibilities through the visitor types, with a separate one for type checking, kernel declaration generation, kernel body generation, and integration header generation. These types have minimal interaction between them.
The visitor pattern also vastly simplifies how each type is handled, since each type has its own handling function, it is only required for an implementer of the visitor to handle one type at a time.
Overall, we hope that this will result in a significantly easier to maintain, modify, and review infrastructure for this functionality.
Signed-off-by: Mariya Podchishchaeva <[email protected]>
Co-authored-by: Erich Keane <[email protected]>
0 commit comments