ianhinder / Kranc

A Mathematica package for generating code for solving time dependent partial differential equations
http://kranccode.org
GNU General Public License v2.0
28 stars 10 forks source link

Output loop kernels into separate functions #97

Open eschnett opened 11 years ago

eschnett commented 11 years ago

Several interesting optimizations depend on being able to re-arrange loop kernels. This requires Mathematica outputting loop kernels into separate functions that can then be called from a driver functions. (This is also very similar to how OpenCL or CUDA work.) These independent kernels should still be vectorized, and should maybe still contain a small loop around them, although the latter is open to research.

The kernel driver could then e.g. daisy-chain several kernels, such as e.g. the several pieces of a BSSN RHS calculation that have been split artificially, or also RHS and boundary conditions. This driver would know about cores, caches, OpenMP etc., and would ensure efficient execution. This would in the end be a replacement for the LoopControl macros, which are not flexible enough to allow such daisy-chaining.