Research Article

Performance Optimization of 3D Lattice Boltzmann Flow Solver on a GPU

Algorithm 8

Code with IF-statement removed.
()is_fluid = (cell_type == FLUID);
()x = a * is_fluid + b * (!is_fluid);