Skip to content

Commit fa37449

Browse files
committed
Fix compile error
Signed-off-by:Tianxiang Wang<tianxiang.wang@metax-tech.com>,Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.
1 parent c790759 commit fa37449

5 files changed

Lines changed: 10 additions & 3 deletions

File tree

source/module_basis/module_pw/pw_basis_k.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ class PW_Basis_K : public PW_Basis
152152
const bool add = false,
153153
const FPTYPE factor = 1.0) const; // in:(nz, ns) ; out(nplane,nx*ny)
154154

155-
#if defined(__CUDA) || defined(__ROCM)
156155
template <typename FPTYPE, typename Device>
157156
void real_to_recip_batch(const Device* ctx,
158157
std::complex<FPTYPE>* in,
@@ -173,7 +172,6 @@ class PW_Basis_K : public PW_Basis
173172
const int batchSize,
174173
const bool add = false,
175174
const FPTYPE factor = 1.0)const; // in:(nz, ns) ; out(nplane,nx*ny)
176-
#endif
177175
public:
178176
//operator:
179177
//get (G+K)^2:

source/module_elecstate/elecstate_pw.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ void ElecStatePW<T, Device>::rhoBandK(const psi::Psi<T, Device>& psi)
172172
{
173173
int npwx = npw / 2;
174174

175+
#if defined(__CUDA) || defined(__ROCM)
175176
// additional memeory : wfcr, wfcr_another_spin, fft data, fft workarea
176177
int batchSize = ModulePW::BatchedFFT<double>::estimate_batch_size(4 * this->basis->nmaxgr * sizeof(T));
177178
if (std::is_same<Device, base_device::DEVICE_GPU>::value && batchSize > 1 && nbands > 1)
@@ -193,6 +194,7 @@ void ElecStatePW<T, Device>::rhoBandK(const psi::Psi<T, Device>& psi)
193194
base_device::memory::delete_memory_op<double, Device>()(this->ctx, wg_gpu);
194195
}
195196
else
197+
#endif
196198
{
197199
for (int ibnd = 0; ibnd < nbands; ibnd++)
198200
{

source/module_elecstate/fp_energy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ double fenergy::calculate_etot()
3636
etot += (ecore + epawdc);
3737
}
3838
#endif
39+
#ifdef __MPI
3940
Parallel_Common::bcast_double(etot);
41+
#endif
4042
return etot;
4143
}
4244

@@ -61,7 +63,9 @@ double fenergy::calculate_harris()
6163
etot_harris += (ecore + epawdc);
6264
}
6365
#endif
66+
#ifdef __MPI
6467
Parallel_Common::bcast_double(etot_harris);
68+
#endif
6569
return etot_harris;
6670
}
6771

source/module_esolver/esolver_ks.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,9 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell)
535535
// EState should be used after it is constructed.
536536

537537
drho = p_chgmix->get_drho(pelec->charge, GlobalV::nelec);
538+
#ifdef __MPI
538539
Parallel_Common::bcast_double(drho);
540+
#endif
539541
double hsolver_error = 0.0;
540542
if (firstscf)
541543
{

source/module_hsolver/diago_dav_subspace.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,9 @@ bool Diago_DavSubspace<T, Device>::diag_zhegvx(const int& nbase,
502502
}
503503
}
504504
}
505-
505+
#ifdef __MPI
506506
MPI_Bcast(&fail_info, 1, MPI_INT, 0, this->diag_comm.comm);
507+
#endif
507508
if(fail_info != 0)
508509
{
509510
return false;

0 commit comments

Comments
 (0)