KinetiX: A performance portable code generator for chemical kinetics and transport properties
Description
We present KinetiX, a software toolkit to generate computationally efficient fuel-specific routines for the chemical source term, thermodynamic and mixture-averaged transport properties for use in combustion simulation codes. The C++ routines are designed for high-performance execution on both CPU and GPU architectures. On CPUs, chemical kinetics computations are optimized by eliminating redundant operations and using data alignment and loops with trivial access patterns that enable auto-vectorization, reducing the latency of complex mathematical operations. On GPUs, performance is improved by loop unrolling, reducing the number of costly exponential evaluations and limiting the number of live variables for better register usage. The accuracy of the generated routines is checked against reference values computed using Cantera and the maximum relative errors are below 10^-7. We evaluate the performance of the kernels on some of the latest CPU and GPU architectures from AMD and NVIDIA, i.e., AMD EPYC 9653, AMD MI250X, and NVIDIA H100. The routines generated by KinetiX outperform the general-purpose Cantera library, achieving speedups of up to 2.4x for species production rates and 3.2x for mixture-averaged transport properties on CPUs. Compared to the routines generated by PelePhysics (CEPTR), KinetiX achieves speedups of up to 2.6x on CPUs and 1.7x on GPUs for the species production rates kernel on a single-threaded basis.