Commit ebe27c65 authored by Stan Moore's avatar Stan Moore
Browse files

Removing duplicate code in pair_exp6_rx_kokkos

parent 85c8db5f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include "force.h"
#include "neigh_list.h"
#include "math_const.h"
#include "math_special.h"
#include "math_special_kokkos.h"
#include "memory.h"
#include "error.h"
#include "modify.h"
@@ -36,7 +36,7 @@

using namespace LAMMPS_NS;
using namespace MathConst;
using namespace MathSpecial;
using namespace MathSpecialKokkos;

#define MAXLINE 1024
#define DELTA 4
+0 −18
Original line number Diff line number Diff line
@@ -150,24 +150,6 @@ class PairExp6rxKokkos : public PairExp6rx {
  friend void pair_virial_fdotr_compute<PairExp6rxKokkos>(PairExp6rxKokkos*);
};


// optimized version of pow(x,n) with n being integer
// up to 10x faster than pow(x,y)

KOKKOS_INLINE_FUNCTION
static double powint(const double &x, const int n) {
  double yy,ww;

  if (x == 0.0) return 0.0;
  int nn = (n > 0) ? n : -n;
  ww = x;

  for (yy = 1.0; nn != 0; nn >>= 1, ww *=ww)
    if (nn & 1) yy *= ww;

  return (n > 0) ? yy : 1.0/yy;
};

}

#endif