ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
meta_op.h
Go to the documentation of this file.
1#ifndef MODULE_HAMILT_META_H
2#define MODULE_HAMILT_META_H
3
5#include "source_psi/psi.h"
6#include <complex>
7
8namespace hamilt {
9 template <typename FPTYPE, typename Device>
10 struct meta_pw_op {
29 const Device* dev,
30 const int& ik,
31 const int& pol,
32 const int& npw,
33 const int& npwx,
34 const FPTYPE& tpiba,
35 const FPTYPE* gcar,
36 const FPTYPE* kvec_c,
37 const std::complex<FPTYPE>* in,
38 std::complex<FPTYPE>* out,
39 const bool add = false);
40 };
41
42#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
43 // Partially specialize functor for base_device::GpuDevice.
44 template <typename FPTYPE>
45 struct meta_pw_op<FPTYPE, base_device::DEVICE_GPU>
46 {
47 void operator()(const base_device::DEVICE_GPU* dev,
48 const int& ik,
49 const int& pol,
50 const int& npw,
51 const int& npwx,
52 const FPTYPE& tpiba,
53 const FPTYPE* gcar,
54 const FPTYPE* kvec_c,
55 const std::complex<FPTYPE>* in,
56 std::complex<FPTYPE>* out,
57 const bool add = false);
58 };
59#endif // __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
60} // namespace hamilt
61#endif //MODULE_HAMILT_META_H
Definition device.cpp:21
Definition hamilt.h:13
Definition meta_op.h:10
void operator()(const Device *dev, const int &ik, const int &pol, const int &npw, const int &npwx, const FPTYPE &tpiba, const FPTYPE *gcar, const FPTYPE *kvec_c, const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const bool add=false)
Compute the metaGGA potential of hPsi in recip space, out = hpsi * (wfcpw->gcar+wfcpw->kvec_c) * this...