# A Neural Network-Inspired Matrix Formulation of Chemical Kinetics for Acceleration on GPUs
## Appendix C Performance Comparison with Non-Matrix Approaches  
The results presented in Section 3 focus solely on the GPU performance of the matrix-based formulations. The discussion below, on the other hand, provides comparisons between the matrix-based approach and two baseline, more conventional approaches that do not utilize the matrix formulations. The algorithmic details of these conventional methods are provided further below. Ultimately, through a direct comparison of evaluation times, the primary goal is to isolate the gain in performance when moving from a more conventional kinetics offloading approach to the matrix-based approach. The secondary goal is to present clearly the GPU offloading algorithms, for both matrix-based and conventional approaches, in terms of the organization of GPU kernels. It should be noted that the definition of \"conventional\" is less obvious when dealing with GPUs. This is because GPU offloading introduces the kernel launch aspect as an additional degree of complexity in the algorithm design: one has to decide how many GPU kernels to break the function evaluation into. In this vein, the so-called kernel \"fissioning\" process must be established. Fissioning refers to the way in which a function evaluation offloaded to a GPU can be broken down into a set of smaller function evaluations to expose more parallelism. Essentially, for a given complex function with many internal stages such as the source term evaluation considered in this work, the _untrissioned_ approach casts the function as a single very large GPU kernel with one principle vectorization direction (i.e., one kernel to replace the main loop over the number of cells, for example), whereas the _fissioned_ approach breaks the function down into a set of smaller GPU kernels to potentially expose multiple vectorization directions and higher thread concurrency (i.e., a given kernel in the fissioned approach may replace a sub-function comprised of a nested for loop that iterates over both cells and species). As detailed below, the matrix-based algorithm profiled in Section 3.1 by design adopts the fissioned approach. Diagrams for the three GPU algorithms are provided in Figure 10. Figure 10a is the conventional untrissioned algorithm, Figure 10b is the conventional fissioned algorithm, and Figure 10c is the matrix-based fissioned algorithm. All three approaches utilize the same inputs and produce the same output \(\mathbf{\Omega}\) (see Section 2.1). The general inputs are the thermodynamic data for each cell (mass fraction, temperature, and density) and chemical mechanism information (stoichiometric matrices, reaction parameters, reaction type indicators, polynomial coefficients, etc.). The key difference is that these inputs are distributed over several kernel launches in the fissioned approach (Figure 10b,c), whereas, in the untrissioned approach (Figure 10a), all inputs are fed into one kernel. Additional relevant details for each approach are discussed below. The algorithm in Figure 10a is labeled as \"conventional\" because it does not operate in the logarithm space--it evaluates the source term using the standard equations. Further, it is \"untrissioned\" because the source term evaluation is represented as a single large kernel. More precisely, Figure 10a captures the effect of threading a direct source term function evaluation over the number of cells, \(N_{C}\), without taking advantage of the reaction and species matrix data structures outlined in Section 2.2. Instead, on each function call, each thread in this algorithm operates on a single cell and loops through every reaction to accumulate the source term contribution for the set of species involved in that particular reaction. As such, within the reaction loop over \(N_{R}\), there are several species loops over \(N_{S}\) (red bullets in Figure 10a) that represent this accumulation of species information (reductions) by means of the stoichiometric matrices.