Skip to content

Commit

Permalink
add a func to create dp position in gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBuZHIDAO committed Dec 31, 2024
1 parent a5ff51f commit 49306ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/force/dp.cu
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ void DP::set_dp_coeff(void) {
}


static __global__ void create_dp_position(
const double* gpumd_position,
const double* dp_position,
int N)
{
int n1 = blockIdx.x * blockDim.x + threadIdx.x; // particle index
if (n1 < N) {
dp_position[n1 * 3] = gpumd_position[n1];
dp_position[n1 * 3 + 1] = gpumd_position[n1 + N];
dp_position[n1 * 3 + 2] = gpumd_position[n1 + 2 * N];
}
}


void DP::compute(
Box& box,
Expand Down

0 comments on commit 49306ed

Please sign in to comment.