Skip to content

Commit 462857f

Browse files
committed
fix bug
1 parent 76893ee commit 462857f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

source/module_psi/psi.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ template <typename T, typename Device>
240240
template <typename T_in, typename Device_in>
241241
Psi<T, Device>::Psi(const Psi<T_in, Device_in>& psi_in)
242242
{
243-
this->ngk = psi_in.ngk;
243+
this->ngk = psi_in.get_ngk_pointer();
244244
this->npol = psi_in.npol;
245245
this->nk = psi_in.get_nk();
246246
this->nbands = psi_in.get_nbands();
@@ -332,6 +332,12 @@ const Device* Psi<T, Device>::get_device() const
332332
return this->ctx;
333333
}
334334

335+
template <typename T, typename Device>
336+
const int* Psi<T, Device>::get_ngk_pointer() const
337+
{
338+
return this->ngk;
339+
}
340+
335341
template <typename T, typename Device>
336342
const int& Psi<T, Device>::get_psi_bias() const
337343
{

source/module_psi/psi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ class Psi
124124

125125
const int& get_ngk(const int ik_in) const;
126126

127+
const int* get_ngk_pointer() const;
128+
127129
// return k_first
128130
const bool& get_k_first() const;
129131

0 commit comments

Comments
 (0)