Skip to content

Commit

Permalink
Change thread and block size calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchwiebert committed Aug 12, 2024
1 parent bd2fd01 commit 5afbe8f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/GPU/CalculateEwaldCUDAKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ void CallBoxReciprocalSetupGPU(VariablesCUDA *vars, XYZArray const &coords,
#endif

dim3 threadsPerBlock(THREADS_PER_BLOCK, 1, 1);
dim3 blocksPerGrid(imageSize + threadsPerBlock.x - 1) / threadsPerBlock.x,
(atomNumber + PARTICLES_PER_BLOCK - 1) / PARTICLES_PER_BLOCK, 1);
dim3 blocksPerGrid(
(imageSize + threadsPerBlock.x - 1) / threadsPerBlock.x,
(atomNumber + PARTICLES_PER_BLOCK - 1) / PARTICLES_PER_BLOCK, 1);
BoxReciprocalSumsGPU<<<blocksPerGrid, threadsPerBlock>>>(
vars->gpu_x, vars->gpu_y, vars->gpu_z, vars->gpu_kx[box],
vars->gpu_ky[box], vars->gpu_kz[box], atomNumber,
Expand Down Expand Up @@ -111,8 +112,9 @@ void CallBoxReciprocalSumsGPU(VariablesCUDA *vars, XYZArray const &coords,
#endif

dim3 threadsPerBlock(THREADS_PER_BLOCK, 1, 1);
dim3 blocksPerGrid(imageSize + threadsPerBlock.x - 1) / threadsPerBlock.x,
(atomNumber + PARTICLES_PER_BLOCK - 1) / PARTICLES_PER_BLOCK, 1);
dim3 blocksPerGrid(
(imageSize + threadsPerBlock.x - 1) / threadsPerBlock.x,
(atomNumber + PARTICLES_PER_BLOCK - 1) / PARTICLES_PER_BLOCK, 1);
BoxReciprocalSumsGPU<<<blocksPerGrid, threadsPerBlock>>>(
vars->gpu_x, vars->gpu_y, vars->gpu_z, vars->gpu_kxRef[box],
vars->gpu_kyRef[box], vars->gpu_kzRef[box], atomNumber,
Expand Down

0 comments on commit 5afbe8f

Please sign in to comment.