From 9cfcb971b92a74f572b8c9bb9fc189ced3685171 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Wed, 2 Apr 2025 12:04:18 -0600 Subject: [PATCH] whitespace --- src/KOKKOS/mliap_unified_kokkos.cpp | 6 ++--- src/KOKKOS/pair_mliap_kokkos.cpp | 38 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/KOKKOS/mliap_unified_kokkos.cpp b/src/KOKKOS/mliap_unified_kokkos.cpp index be327aedc2..1e57b8888c 100644 --- a/src/KOKKOS/mliap_unified_kokkos.cpp +++ b/src/KOKKOS/mliap_unified_kokkos.cpp @@ -272,11 +272,11 @@ void LAMMPS_NS::update_pair_energy(MLIAPDataKokkosDevice *data, double *eij) auto d_eatoms = data->eatoms; auto d_pair_i= data->pair_i; const auto nlocal = data->nlocal; - Kokkos::parallel_for(nlocal, KOKKOS_LAMBDA(int ii){ + Kokkos::parallel_for(nlocal, KOKKOS_LAMBDA(int ii) { d_eatoms[ii] = 0; }); - Kokkos::parallel_reduce(data->npairs, KOKKOS_LAMBDA(int ii, double &local_sum){ + Kokkos::parallel_reduce(data->npairs, KOKKOS_LAMBDA(int ii, double &local_sum) { int i = d_pair_i[ii]; double e = 0.5 * eij[ii]; @@ -377,7 +377,7 @@ void LAMMPS_NS::update_atom_energy(MLIAPDataKokkosDevice *data, double *ei) auto d_eatoms = data->eatoms; const auto nlocal = data->nlocal; - Kokkos::parallel_reduce(nlocal, KOKKOS_LAMBDA(int i, double &local_sum){ + Kokkos::parallel_reduce(nlocal, KOKKOS_LAMBDA(int i, double &local_sum) { double e = ei[i]; d_eatoms[i] = e; diff --git a/src/KOKKOS/pair_mliap_kokkos.cpp b/src/KOKKOS/pair_mliap_kokkos.cpp index e9ae6971db..2c6e427454 100644 --- a/src/KOKKOS/pair_mliap_kokkos.cpp +++ b/src/KOKKOS/pair_mliap_kokkos.cpp @@ -336,9 +336,9 @@ int PairMLIAPKokkos::forward_comm(CommType* copy_from_, CommType* co static_assert( std::is_same_v || std::is_same_v, "Unsupported CommType"); - if constexpr ( std::is_same_v ){ + if constexpr ( std::is_same_v ) { comm_type = COMM_TYPE::FLOAT; - } else if constexpr ( std::is_same_v ){ + } else if constexpr ( std::is_same_v ) { comm_type = COMM_TYPE::DOUBLE; } copy_to = copy_to_; @@ -362,9 +362,9 @@ int PairMLIAPKokkos::reverse_comm(CommType* copy_from_, CommType* co static_assert( std::is_same_v || std::is_same_v, "Unsupported CommType"); - if constexpr ( std::is_same_v ){ + if constexpr ( std::is_same_v ) { comm_type = COMM_TYPE::FLOAT; - } else if constexpr ( std::is_same_v ){ + } else if constexpr ( std::is_same_v ) { comm_type = COMM_TYPE::DOUBLE; } copy_to = copy_to_; @@ -392,7 +392,7 @@ template int PairMLIAPKokkos::pack_forward_comm_kokkos( int nv, DAT::tdual_int_1d idx_v, DAT::tdual_xfloat_1d &fill, int int2, int *intp) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return pack_forward_comm_kokkos(nv,idx_v,fill,int2,intp,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -415,7 +415,7 @@ int PairMLIAPKokkos::pack_forward_comm_kokkos( auto val=fill.view(); int nf=vec_len; auto to=copy_to; - Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i){ + Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i) { int gstart=idx(i)*nf; int start=i*nf; for (int j=0;j::pack_forward_comm(int nv, int* idx_v, double *f error->warning(FLERR,"PackForwardComm has only been tested on Kokkos devices"); first=false; } - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return pack_forward_comm(nv,idx_v,fill,int2,intp,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -452,7 +452,7 @@ template int PairMLIAPKokkos::pack_forward_comm(int nv, int* idx_v, double *fill, int int2, int *intp, CommType *copy_to) { - for (int i=0;i::pack_forward_comm(int nv, int* idx_v, double *f template void PairMLIAPKokkos::unpack_forward_comm_kokkos( int nv, int first_up, DAT::tdual_xfloat_1d &fill) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return unpack_forward_comm_kokkos(nv,first_up,fill,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -485,7 +485,7 @@ void PairMLIAPKokkos::unpack_forward_comm_kokkos( auto val=fill.view(); int nf=vec_len; - Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i){ + Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i) { int gstart=(first_up+i)*nf; int start=i*nf; for (int j=0;j::unpack_forward_comm_kokkos( template void PairMLIAPKokkos::unpack_forward_comm(int nv, int first_up, double *fill) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return unpack_forward_comm(nv,first_up,fill,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -527,7 +527,7 @@ void PairMLIAPKokkos::unpack_forward_comm( template int PairMLIAPKokkos::pack_reverse_comm_kokkos(int nv, int first_up, DAT::tdual_xfloat_1d &fill) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return pack_reverse_comm_kokkos(nv,first_up,fill,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -547,7 +547,7 @@ int PairMLIAPKokkos::pack_reverse_comm_kokkos(int nv, int first_up, { int nf=vec_len; auto val=fill.view(); - Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i){ + Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i) { int gstart=(first_up+i)*nf; int start=i*nf; for (int j=0;j::pack_reverse_comm_kokkos(int nv, int first_up, template int PairMLIAPKokkos::pack_reverse_comm(int nv, int first_up, double *fill) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return pack_reverse_comm(nv,first_up,fill,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -578,7 +578,7 @@ template template int PairMLIAPKokkos::pack_reverse_comm(int nv, int first_up, double *fill, CommType *copy_to) { - for (int i=0;i::pack_reverse_comm(int nv, int first_up, double template void PairMLIAPKokkos::unpack_reverse_comm_kokkos(int nv, DAT::tdual_int_1d idx_v, DAT::tdual_xfloat_1d &fill) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return unpack_reverse_comm_kokkos(nv,idx_v,fill,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -615,7 +615,7 @@ void PairMLIAPKokkos::unpack_reverse_comm_kokkos(int nv, DAT::tdual_ auto val=fill.view(); auto idx=idx_v.view(); auto to=copy_to; - Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i){ + Kokkos::parallel_for(nv, KOKKOS_LAMBDA (int i) { int gstart=idx(i)*nf; int start=i*nf; for (int j=0;j::unpack_reverse_comm_kokkos(int nv, DAT::tdual_ template void PairMLIAPKokkos::unpack_reverse_comm(int nv, int *idx, double *fill) { - switch( comm_type ){ + switch( comm_type ) { case COMM_TYPE::FLOAT: return unpack_reverse_comm(nv,idx,fill,std::get(copy_to)); case COMM_TYPE::DOUBLE: @@ -646,7 +646,7 @@ template template void PairMLIAPKokkos::unpack_reverse_comm(int nv, int *idx, double *fill, CommType *copy_to) { - for (int i=0;i