Add force calculation kernel and fix incorrect ctest configuration for Cuda tests

This commit is contained in:
Alex Selimov 2025-08-27 22:07:47 -04:00
parent cad74747bf
commit dc74e4e5c0
Signed by: aselimov
GPG key ID: 3DDB9C3E023F1F31
6 changed files with 348 additions and 6 deletions

19
kernels/forces.cuh Normal file
View file

@ -0,0 +1,19 @@
#ifndef FORCES_CUH
#define FORCES_CUH
#include "pair_potentials.cuh"
#include "precision.hpp"
namespace CAC {
/**
* Calculate forces and energies using CUDA for acceleration
* This code currently only accepts a single PairPotential object and does an
* n^2 force calculation. Future improvements will:
* - Allow for neighbor listing
* - Allow for overlaid force calculations
*/
__global__ void calc_forces_and_energies(real *xs, real *forces, real *energies,
int n_particles, real *box_bd,
PairPotential &potential);
} // namespace CAC
#endif