GPU-accelerated implicit solver for diffusion problems on unstructured grids
Abstract
Implicit solvers on unstructured grids are widely used for diffusion-type problems because of their robustness and geometric flexibility. However, their efficiency in large-scale simulations is often limited by coefficient assembly, sparse linear-system solution, and irregular memory access caused by indirect grid connectivity. In this work, a GPUaccelerated implicit solver for diffusion problems is developed within the CMP platform. Two acceleration schemes are implemented and compared. In the hybrid CPU-GPU scheme, the coefficient matrix is assembled on the CPU, while only the sparse linear solver is executed on the GPU. In the full-process GPU scheme, discretization, matrix assembly, and linear solution are all performed on the GPU. AMGX is used for sparse linear solving, and the face-based discretization and assembly kernels on unstructured grids are redesigned in CUDA. To examine memory-access behavior, three data layouts, namely SoA, LAOS1, and LAOS2, are evaluated for the main face-based kernels. Four benchmark cases, including two-dimensional and three-dimensional configurations with both regular and complex geometries, are used to assess accuracy, convergence, scalability, memory behavior, and data-layout effects. The GPU solutions agree well with the CPU solutions and reference results, and the residual histories remain consistent among the computing schemes. Compared with the hybrid CPU-GPU scheme, the full-process GPU scheme achieves higher acceleration by reducing CPU-side assembly and repeated host-device transfer. For cases with more than one million cells, the measured speedup of the hybrid scheme reaches approximately 70% of the theoretical upper bound estimated by Amdahl's law. The data-layout results show that layout optimization has a limited effect in two-dimensional cases with relatively good locality, but becomes more effective for three-dimensional unstructured grids. By packing frequently co-accessed and indirectly accessed variables into localized AoS-like structures, LAOS can improve spatial locality on irregular three-dimensional grids and reduces scattered memory-access overhead. Among the tested layouts, LAOS1 provides the most stable overall improvement, whereas the benefit of LAOS2 depends more strongly on the access pattern of each kernel.