Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep K80 to be usable #846

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading