GROMACS version: 2024
GROMACS modification: Yes/No
Here post your question:
Hi, I would be interested in getting the preprocessed kernel codes (plain C / SIMD / OpenCL) out for inspection. For me, this does not seem trivial as they are present as “templates” and expanded with defines+includes. I managed to do that for OpenCL kernels by running the .cl sources through compiler preprocessor. But for cpu kernels this seems painful to accomplish. Is there any easier way to do this?
For CPU kernels, I’d do something like VERBOSE=1 make, find the command building the object of interest (CPU kernels are split among several .cpp files), and then copy-paste it and add the -E flag to output the preprocessed source. I don’t think there’s a much better way.
Indeed. I also think eliminating some of the conditionals would be great since now all branching and indentation makes the code huge compared to the previous preprocessed kernels, but I am not sure if such tools exist.