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{
10template <typename FPTYPE, typename Device>
12{
31 const Device *dev,
32 const int &ik,
33 const int &pol,
34 const int &npw,
35 const int &npwx,
36 const FPTYPE &tpiba,
37 const FPTYPE *gcar,
38 const FPTYPE *kvec_c,
39 const std::complex<FPTYPE> *in,
40 std::complex<FPTYPE> *out,
41 const bool add = false);
42};
43
44#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
45// Partially specialize functor for base_device::GpuDevice.
46template <typename FPTYPE>
47struct meta_pw_op<FPTYPE, base_device::DEVICE_GPU>
48{
49 void operator()(
50 const base_device::DEVICE_GPU *dev,
51 const int &ik,
52 const int &pol,
53 const int &npw,
54 const int &npwx,
55 const FPTYPE &tpiba,
56 const FPTYPE *gcar,
57 const FPTYPE *kvec_c,
58 const std::complex<FPTYPE> *in,
59 std::complex<FPTYPE> *out,
60 const bool add = false);
61};
62#endif // __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
63} // namespace hamilt
64#endif // MODULE_HAMILT_META_H
Definition device.cpp:21
Definition wf_op.cpp:6
Definition meta_op.h:12
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...