omlins / ParallelStencil.jl

Package for writing high-level code for parallel high-performance stencil computations that can be deployed on both GPUs and CPUs
BSD 3-Clause "New" or "Revised" License
311 stars 31 forks source link

Code generation for multiple stencils #71

Open smartalecH opened 1 year ago

smartalecH commented 1 year ago

Often, a particular stencil-based code can contain dozens or even hundreds of variations of the most "complete" stencil. For example, depending on what parameters the simulation is running, it may only need certain aspects of the most complete case.

In C/C++, many codes use some sort of code generation/ metaprogramming to handle the combinatorial explosion that occurs in these cases.

Has anyone explored @parallel kernel generation in this context? I tried creating a @generated function from a @parallel construct, but was running into some issues.

Just curious if others have thought of this. Thanks!

omlins commented 1 year ago

@albert-de-montserrat has mentioned once the intention to do something like that in a similar context. @albert-de-montserrat, did you follow up on that in the end?

albert-de-montserrat commented 1 year ago

No sorry, didn't have the chance to follow up on this idea.