Skip to content

Commit

Permalink
accumulate force
Browse files Browse the repository at this point in the history
  • Loading branch information
brucefan1983 committed Jul 27, 2024
1 parent 8dcc497 commit 8b80d41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main_gpumd/add_random_force.cu
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ static __global__ void add_random_force(
int n = blockIdx.x * blockDim.x + threadIdx.x;
if (n < N) {
curandState state = g_state[n];
g_fx[n] = force_variance * curand_normal_double(&state);
g_fy[n] = force_variance * curand_normal_double(&state);
g_fz[n] = force_variance * curand_normal_double(&state);
g_fx[n] += force_variance * curand_normal_double(&state);
g_fy[n] += force_variance * curand_normal_double(&state);
g_fz[n] += force_variance * curand_normal_double(&state);
g_state[n] = state;
}
}
Expand Down

0 comments on commit 8b80d41

Please sign in to comment.