Avoid potential integer overflow in warp arithmetic 31/4631/1
authorJim Phillips <jim@ks.uiuc.edu>
Fri, 28 Sep 2018 20:44:57 +0000 (15:44 -0500)
committerJim Phillips <jim@ks.uiuc.edu>
Fri, 28 Sep 2018 20:44:57 +0000 (15:44 -0500)
commit6254ba7157d1f5999ff022d41c6f52050c930c5c
tree99974c50171c8dafa63f99401688e322300606c0
parent34b347b0c314715bcaa40528601a4ec3e92862dd
Avoid potential integer overflow in warp arithmetic

Replace blockDim.x*foo/WARPSIZE with blockDim.x/WARPSIZE*foo
since we know blockDim.x is a multiple of WARPSIZE.  This avoids
overflow of blockDim.x*foo for large foo (blockIdx.x or gridDim.x).
This fix is cautionary as no bug has actually been observed.

Change-Id: I276feb01323d2b677a0456254d026681cd39f56c
src/CudaComputeGBISKernel.cu
src/CudaComputeNonbondedKernel.cu
src/CudaTileListKernel.cu