Remove epsfac from GPU kernel inner-loops
commitd1a07e21a9e92e374ebd40da2c39ff223a9138e1
authorBerk Hess <hess@kth.se>
Thu, 25 Feb 2016 19:27:36 +0000 (25 20:27 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Sat, 27 Feb 2016 17:49:14 +0000 (27 18:49 +0100)
tree03569069a701c463a63a4b9da5056d2af9df9c0b
parentcb313c7e66b36b25e4c54db9934cad613418ecd1
Remove epsfac from GPU kernel inner-loops

Multiplying the i-charge instead of the j-charge with epsfac in
the GPU kernels removes a flop form the inner-loop. On Maxwell with
CUDA the gain is 2-3% in the force kernels and 3-4% in the energy
kernels (which is more than a flop, probably a register less is used).
There is a single additional division in the energy kernel, but the
gain more than compensates for this.

Change-Id: I6924b32f3f61d3b7bbe532f95361b7fefb577609
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_amd.clh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_nowarp.clh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_nvidia.clh