Fix logic for Kokkos hybrid atomvec

This commit is contained in:
Stan Moore
2023-01-24 14:11:25 -07:00
parent 7f2e34ff57
commit 9560fe2dd1

View File

@ -379,10 +379,14 @@ void AtomKokkos::sync_modify(ExecutionSpace execution_space, unsigned int datama
AtomVec *AtomKokkos::new_avec(const std::string &style, int trysuffix, int &sflag)
{
// check if avec already exists, if so this is a hybrid substyle
int hybrid_substyle_flag = (avec != nullptr);
AtomVec *avec = Atom::new_avec(style, trysuffix, sflag);
if (!avec->kokkosable) error->all(FLERR, "KOKKOS package requires a kokkos enabled atom_style");
if (!avecKK) // for hybrid
if (!hybrid_substyle_flag)
avecKK = dynamic_cast<AtomVecKokkos*>(avec);
return avec;