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