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

Add sync/modify for growing dvector

parent 439e7da0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "memory_kokkos.h"
#include "error.h"
#include "kokkos.h"
#include "atom_masks.h"

using namespace LAMMPS_NS;

@@ -270,8 +271,10 @@ int AtomKokkos::add_custom(const char *name, int flag)
    int n = strlen(name) + 1;
    dname[index] = new char[n];
    strcpy(dname[index],name);
    this->sync(Device,DVECTOR_MASK);
    memoryKK->grow_kokkos(k_dvector,dvector,ndvector,nmax,
                        "atom:dvector");
    this->modified(Device,DVECTOR_MASK);
  }

  return index;
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "memory_kokkos.h"
#include "error.h"
#include "update.h"
#include "atom_masks.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -61,8 +62,10 @@ void FixPropertyAtomKokkos::grow_arrays(int nmax)
      size_t nbytes = (nmax-nmax_old) * sizeof(int);
      memset(&atom->ivector[index[m]][nmax_old],0,nbytes);
    } else if (style[m] == DOUBLE) {
      atomKK->sync(Device,DVECTOR_MASK);
      memoryKK->grow_kokkos(atomKK->k_dvector,atomKK->dvector,atomKK->k_dvector.extent(0),nmax,
                          "atom:dvector");
      atomKK->modified(Device,DVECTOR_MASK);
      //memory->grow(atom->dvector[index[m]],nmax,"atom:dvector");
      //size_t nbytes = (nmax-nmax_old) * sizeof(double);
      //memset(&atom->dvector[index[m]][nmax_old],0,nbytes);