@@ -133,6 +133,66 @@ void Stochastic_Iter<T, Device>::cal_storho(const UnitCell& ucell,
133133Charge::Charge (){};
134134Charge::~Charge (){};
135135
136+ // Mock implementations for the template functions causing linking errors
137+ namespace ModulePW {
138+ // Mock implementation for recip_to_real
139+ template <typename FPTYPE, typename Device>
140+ void PW_Basis_K::recip_to_real (const Device* ctx,
141+ const std::complex <FPTYPE>* in,
142+ std::complex <FPTYPE>* out,
143+ const int ik,
144+ const bool add,
145+ const FPTYPE factor) const
146+ {
147+ // Simple mock implementation that does nothing
148+ // In a real test, you might want to implement behavior that simulates the actual function
149+ }
150+
151+ // Mock implementation for real_to_recip
152+ template <typename FPTYPE, typename Device>
153+ void PW_Basis_K::real_to_recip (const Device* ctx,
154+ const std::complex <FPTYPE>* in,
155+ std::complex <FPTYPE>* out,
156+ const int ik,
157+ const bool add,
158+ const FPTYPE factor) const
159+ {
160+ // Simple mock implementation that does nothing
161+ }
162+
163+ // Explicit template instantiations
164+ template void PW_Basis_K::recip_to_real<float , base_device::DEVICE_CPU>(
165+ const base_device::DEVICE_CPU* ctx,
166+ const std::complex <float >* in,
167+ std::complex <float >* out,
168+ const int ik,
169+ const bool add,
170+ const float factor) const ;
171+
172+ template void PW_Basis_K::recip_to_real<double , base_device::DEVICE_CPU>(
173+ const base_device::DEVICE_CPU* ctx,
174+ const std::complex <double >* in,
175+ std::complex <double >* out,
176+ const int ik,
177+ const bool add,
178+ const double factor) const ;
179+
180+ template void PW_Basis_K::real_to_recip<float , base_device::DEVICE_CPU>(
181+ const base_device::DEVICE_CPU* ctx,
182+ const std::complex <float >* in,
183+ std::complex <float >* out,
184+ const int ik,
185+ const bool add,
186+ const float factor) const ;
187+
188+ template void PW_Basis_K::real_to_recip<double , base_device::DEVICE_CPU>(
189+ const base_device::DEVICE_CPU* ctx,
190+ const std::complex <double >* in,
191+ std::complex <double >* out,
192+ const int ik,
193+ const bool add,
194+ const double factor) const ;
195+ }
136196/* ***********************************************
137197 * unit test of HSolverPW_SDFT class
138198 ***********************************************/
0 commit comments