Skip to content

Commit

Permalink
Merge pull request #846 from brucefan1983/k80_back
Browse files Browse the repository at this point in the history
keep K80 to be usable
  • Loading branch information
brucefan1983 authored Jan 3, 2025
2 parents c0c7543 + 202f4cd commit 2a4aa2b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/force/nep_small_box.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@
#include "utilities/nep_utilities.cuh"
#include "utilities/gpu_macro.cuh"

#ifdef USE_KEPLER
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 600)
static __device__ __inline__ double atomicAdd(double* address, double val)
{
unsigned long long* address_as_ull = (unsigned long long*)address;
unsigned long long old = *address_as_ull, assumed;
do {
assumed = old;
old =
atomicCAS(address_as_ull, assumed, __double_as_longlong(val + __longlong_as_double(assumed)));

} while (assumed != old);
return __longlong_as_double(old);
}
#endif
#endif

static __device__ void apply_mic_small_box(
const Box& box, const NEP::ExpandedBox& ebox, double& x12, double& y12, double& z12)
{
Expand Down

0 comments on commit 2a4aa2b

Please sign in to comment.