In this paper, we present the accelerator model of MetaFork together with the software framework that allows automatic generation of CUDA code from annotated MetaFork programs. One of the key features of this CUDA code generator is that it supports the generation of CUDA kernel code where program parameters (like number of threads per block) and machine parameters (like shared memory size) are allowed. These parameters need not to be known at code-generation-time: machine parameters and program parameters can be respectively determined and optimized when the generated code is installed on the target machine.#R##N##R##N#This generation of parametric CUDA kernels requires from the MetaFork framework to deal with non-linear polynomial expressions during the dependence analysis and tiling phase of the MetaFork code. To achieve these algebraic calculations, we take advantage of quantifier elimination and its implementation in the RegularChains in Maple. Various illustrative examples are provided together with performance evaluation.
['Changbo Chen', 'Xiaohui Chen', 'Abdoul-Kader Keita', 'Marc Moreno Maza', 'Ning Xie']
MetaFork: a compilation framework for concurrency models targeting hardware accelerators and its application to the generation of parametric CUDA kernels