@@ -683,6 +683,7 @@ NNPInter::~NNPInter() {
683683 #endif
684684}
685685
686+ #ifdef USE_CUDA_TOOLKIT
686687void NNPInter::update_nbor (const InternalNeighborList & nlist, const int nloc) {
687688 if (!init_nbor) {
688689 sec_a = cum_sum (get_sel_a ());
@@ -742,6 +743,7 @@ void NNPInter::update_nbor(const InternalNeighborList & nlist, const int nloc) {
742743 cudaErrcheck (cudaMemcpy (jrange, &nlist.jrange [0 ], sizeof (int ) * nlist.jrange .size (), cudaMemcpyHostToDevice));
743744 cudaErrcheck (cudaMemcpy (jlist, &nlist.jlist [0 ], sizeof (int ) * nlist.jlist .size (), cudaMemcpyHostToDevice));
744745}
746+ #endif // USE_CUDA_TOOLKIT
745747
746748#ifdef USE_CUDA_TOOLKIT
747749void
@@ -912,7 +914,7 @@ compute (ENERGYTYPE & dener,
912914{
913915 int nall = dcoord_.size () / 3 ;
914916 int nloc = nall - nghost;
915- NNPAtomMap<VALUETYPE> nnpmap (datype_.begin (), datype_.begin () + nloc);
917+ nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.begin () + nloc);
916918 assert (nloc == nnpmap.get_type ().size ());
917919 validate_fparam_aparam (nloc, fparam, aparam);
918920
@@ -946,7 +948,7 @@ compute (ENERGYTYPE & dener,
946948 nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.begin () + nloc);
947949 assert (nloc == nnpmap.get_type ().size ());
948950
949- InternalNeighborList nlist;
951+ // InternalNeighborList nlist;
950952 convert_nlist_lmp_internal (nlist, lmp_list);
951953 shuffle_nlist (nlist, nnpmap);
952954 std::vector<std::pair<string, Tensor>> input_tensors;
@@ -987,7 +989,7 @@ compute (ENERGYTYPE & dener,
987989 const vector<VALUETYPE> & fparam,
988990 const vector<VALUETYPE> & aparam)
989991{
990- NNPAtomMap<VALUETYPE> nnpmap (datype_.begin (), datype_.end ());
992+ nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.end ());
991993 validate_fparam_aparam (nnpmap.get_type ().size (), fparam, aparam);
992994
993995 std::vector<std::pair<string, Tensor>> input_tensors;
@@ -1019,10 +1021,10 @@ compute (ENERGYTYPE & dener,
10191021 validate_fparam_aparam (nloc, fparam, aparam);
10201022
10211023 if (ago == 0 ) {
1022- NNPAtomMap<VALUETYPE> nnpmap (datype_.begin (), datype_.begin () + nloc);
1024+ nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.begin () + nloc);
10231025 assert (nloc == nnpmap.get_type ().size ());
10241026
1025- InternalNeighborList nlist;
1027+ // InternalNeighborList nlist;
10261028 convert_nlist_lmp_internal (nlist, lmp_list);
10271029 shuffle_nlist (nlist, nnpmap);
10281030 std::vector<std::pair<string, Tensor>> input_tensors;
@@ -1240,7 +1242,8 @@ get_max_sec()
12401242 }
12411243}
12421244
1243- void
1245+ #ifdef USE_CUDA_TOOLKIT
1246+ void
12441247NNPInterModelDevi::
12451248update_nbor (const InternalNeighborList & nlist, const int nloc)
12461249{
@@ -1303,6 +1306,7 @@ update_nbor(const InternalNeighborList & nlist, const int nloc)
13031306 cudaErrcheck (cudaMemcpy (jrange, &nlist.jrange [0 ], sizeof (int ) * nlist.jrange .size (), cudaMemcpyHostToDevice));
13041307 cudaErrcheck (cudaMemcpy (jlist, &nlist.jlist [0 ], sizeof (int ) * nlist.jlist .size (), cudaMemcpyHostToDevice));
13051308}
1309+ #endif // USE_CUDA_TOOLKIT
13061310
13071311void
13081312NNPInterModelDevi::
@@ -1332,7 +1336,7 @@ compute (ENERGYTYPE & dener,
13321336{
13331337 if (numb_models == 0 ) return ;
13341338
1335- NNPAtomMap<VALUETYPE> nnpmap (datype_.begin (), datype_.end ());
1339+ nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.end ());
13361340 validate_fparam_aparam (nnpmap.get_type ().size (), fparam, aparam);
13371341
13381342 std::vector<std::pair<string, Tensor>> input_tensors;
@@ -1389,7 +1393,7 @@ compute (vector<ENERGYTYPE> & all_energy,
13891393 nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.begin () + nloc);
13901394 assert (nloc == nnpmap.get_type ().size ());
13911395
1392- InternalNeighborList nlist;
1396+ // InternalNeighborList nlist;
13931397 convert_nlist_lmp_internal (nlist, lmp_list);
13941398 shuffle_nlist (nlist, nnpmap);
13951399 std::vector<std::pair<string, Tensor>> input_tensors;
@@ -1453,7 +1457,7 @@ compute (vector<ENERGYTYPE> & all_energy,
14531457 nnpmap = NNPAtomMap<VALUETYPE> (datype_.begin (), datype_.begin () + nloc);
14541458 assert (nloc == nnpmap.get_type ().size ());
14551459
1456- InternalNeighborList nlist;
1460+ // InternalNeighborList nlist;
14571461 convert_nlist_lmp_internal (nlist, lmp_list);
14581462 shuffle_nlist (nlist, nnpmap);
14591463 std::vector<std::pair<string, Tensor>> input_tensors;
0 commit comments