How to transform Mako template into c- or cuda-type?

42 views
Skip to first unread message

Kiny Wan

unread,
Jul 2, 2020, 10:28:28 PM7/2/20
to PyFR Mailing List
Dear all, 

        In the publication of PyFR (PyFR: An open source framework for solving advection–diffusion type problems on streaming architectures using the flux reconstruction approach),  the idea of Mako is very interesting that extends a small piece of code into c- or cuda-type. I would like to ask about which python file in PyFR controls the transformation? and how to find the generated CUDA source/OpenMP annotated C source related to corresponding Mako template?

Regards
Kiny

Freddie Witherden

unread,
Jul 2, 2020, 10:36:16 PM7/2/20
to pyfrmai...@googlegroups.com
The translation is mostly done in the various subclasses of
BaseKernelGenerator in:

<https://github.com/PyFR/PyFR/blob/develop/pyfr/backends/base/generator.py>

Some of the Mako related functions are inside makoutil:

<https://github.com/PyFR/PyFR/blob/develop/pyfr/backends/base/makoutil.py>

If you want to see what the generated code looks like you can put a
print statement around:

<https://github.com/PyFR/PyFR/blob/develop/pyfr/backends/base/kernels.py#L80>

Regards, Freddie.

Kiny Wan

unread,
Jul 2, 2020, 11:26:50 PM7/2/20
to PyFR Mailing List
Hi Freddie, thank you. 
Reply all
Reply to author
Forward
0 new messages