Hello everyone,


There are a lot of attempts to make C programming more comfortable with some C code generation techniques. They are often based on macroses or DSLs. Many C programmers have their own pet macroprocessor/preprocessors/generator for C code.


I decided to publish my own tool which I started to use rather successfully to automate implementations of some compute-intensive code typical for HPC. The compute-intensive code normally comes in number of variations: same formula must be effectively translated for 1D, 2D and 3D cases, with different approximations, different variable types, for CUDA and CPU. C code generation makes it possible to write and debug less and get all that variations from a single source.


Here it is, no good docs yet, only samples:
GitHub - a-v-medvedev/cppcgen: Generator of C code written in C++-11


The most comprehensive sample for today is test7, which implements rather typical boundary update problem for a regular grid.


Please feel free to comment, use or share ideas.


--
Regards,
Alexey