forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GPU: Add multi-device support for ekinetic hpsi (#1428)
* add a device template for class psi * add headfile STL string * address comments * add a description for function memory::abacus_resize_memory * seperate class psi * fix CI errors * fix CI errors * add destructor for psi * fix cuda building errors * add copy constructor for template class * fix CI tests * add device template for class diag_cg * GPU: removing std::vector from class diago_cg (#1366) * removing std::vector from class diago_cg * fix UT errors * add multi device support for function ddot_real * add UT for the new method! * use template functors as the interface of multi device implementations * add comments for head files * fix UT's error * update functions of math_kernel * Add UTs for all functors within module_psi * fix CI error * Update source/module_hsolver/include/math_kernel.h * Update source/module_hsolver/src/math_kernel.cpp * fix cuda complie bug * add vector_div_constant_op_cpu UT * fix Hsolver_UTs bug * update Hsolvers_UTs: tests for double math_kernel funcitons * Close USE_CUDA * replace ZEROS©ARRAY function in diago_cg.cpp * fix format * add gemm function to math_kernel * add cgemm_ to blas_connector * replace some function in davidson * fix CI error * Update CMakeLists.txt * add template for class DiagoDavid * Add multi-device support for ekinetic hpsi * fix CI error * Add multi device support for HPsi(nonlocal_pw) * add .idea to .gitignore * fix CI error * GPU: Address comments of PR#1428 (#1440) * docs: skeletion of developer docs * update titles in docs * adjust titles * docs: adjust contribution guide * update again contribution guide * adjust docs' skeleton * remove documentation and notes temporarily * remote documentation title * add an item in faq * trial title * trials of index * add contribution process * update contribution guide * fix typo * update skeleton * update hands_on.md * adjust file position * separate fictitious force from total force in md_lgv (#1412) * refactor: append output of H/S(R) matrix * test: update test 207_NO_KP_OH2 * fix: separate fictitious force in md_lgv * refactor: remove __LCAO in module_md * delete useless files in module_md * init md velocity using Gaussian random * test: update MD_func_test * update tests of MD_func again * fix: fix bugs during merge * fix: output the cartesian coordinate in cube file (#1426) * Update docs/community/contribution_guide.md Co-authored-by: Chun Cai <amoycaic@gmail.com> * modify words in faq.md * Build: abacus can compile pw version with cmake (#1397) * Build: revise some typos * build:abacus can compile pw version with cmake; add workflow * change Makefile.vars * fix wrong tag in build_test.yml * fix wrong indentations * merge * Build: change modules to cmake (#1431) * fix conclicts * use {} instead of std::complex<double> * use Operator_PW as class template * fix CI error * remove unused headfile import Co-authored-by: hongriTianqi <z.hao.1@163.com> Co-authored-by: Tianqi Zhao <hongriTianqi@users.noreply.github.com> Co-authored-by: Yu Liu <77716030+YuLiu98@users.noreply.github.com> Co-authored-by: pxlxingliang <91927439+pxlxingliang@users.noreply.github.com> Co-authored-by: Chun Cai <amoycaic@gmail.com> Co-authored-by: Qianrui <76200646+Qianruipku@users.noreply.github.com> Co-authored-by: Qianrui <76200646+Qianruipku@users.noreply.github.com> Co-authored-by: haozhihan <haozhi.han@stu.pku.edu.cn> Co-authored-by: North <haozhi.han@outlook.com> Co-authored-by: dyzheng <zhengdy@dp.tech> Co-authored-by: hongriTianqi <z.hao.1@163.com> Co-authored-by: Tianqi Zhao <hongriTianqi@users.noreply.github.com> Co-authored-by: Yu Liu <77716030+YuLiu98@users.noreply.github.com> Co-authored-by: pxlxingliang <91927439+pxlxingliang@users.noreply.github.com> Co-authored-by: Chun Cai <amoycaic@gmail.com>
- Loading branch information
1 parent
02f0658
commit 736ccf7
Showing
70 changed files
with
5,259 additions
and
1,214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ STRU_READIN_ADJUST.cif | |
*.egg | ||
*.egg-info | ||
build | ||
dist | ||
dist | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef MODULE_HAMILT_EKINETIC_H | ||
#define MODULE_HAMILT_EKINETIC_H | ||
|
||
#include "module_psi/psi.h" | ||
#include <complex> | ||
|
||
namespace hamilt { | ||
template <typename FPTYPE, typename Device> | ||
struct ekinetic_pw_op { | ||
void operator() ( | ||
const Device* dev, | ||
const int& nband, | ||
const int& npw, | ||
const int& max_npw, | ||
const FPTYPE& tpiba2, | ||
const FPTYPE* gk2_ik, | ||
std::complex<FPTYPE>* tmhpsi, | ||
const std::complex<FPTYPE>* tmpsi_in); | ||
}; | ||
|
||
#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM | ||
// Partially specialize functor for psi::GpuDevice. | ||
template <typename FPTYPE> | ||
struct ekinetic_pw_op<FPTYPE, psi::DEVICE_GPU> { | ||
void operator() ( | ||
const psi::DEVICE_GPU* dev, | ||
const int& nband, | ||
const int& npw, | ||
const int& max_npw, | ||
const FPTYPE& tpiba2, | ||
const FPTYPE* gk2_ik, | ||
std::complex<FPTYPE>* tmhpsi, | ||
const std::complex<FPTYPE>* tmpsi_in); | ||
}; | ||
#endif // __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM | ||
} // namespace hamilt | ||
#endif //MODULE_HAMILT_EKINETIC_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#ifndef MODULE_HAMILT_NONLOCAL_H | ||
#define MODULE_HAMILT_NONLOCAL_H | ||
|
||
#include "module_psi/psi.h" | ||
#include <complex> | ||
|
||
namespace hamilt { | ||
template <typename FPTYPE, typename Device> | ||
struct nonlocal_pw_op { | ||
void operator() ( | ||
const Device* dev, | ||
const int& l1, | ||
const int& l2, | ||
const int& l3, | ||
int& sum, | ||
int& iat, | ||
const int& spin, | ||
const int& nkb, | ||
const int& deeq_x, | ||
const int& deeq_y, | ||
const int& deeq_z, | ||
const FPTYPE* deeq, | ||
std::complex<FPTYPE>* ps, | ||
const std::complex<FPTYPE>* becp); | ||
}; | ||
|
||
#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM | ||
// Partially specialize functor for psi::GpuDevice. | ||
template <typename FPTYPE> | ||
struct nonlocal_pw_op<FPTYPE, psi::DEVICE_GPU> { | ||
void operator() ( | ||
const psi::DEVICE_GPU* dev, | ||
const int& l1, | ||
const int& l2, | ||
const int& l3, | ||
int& sum, | ||
int& iat, | ||
const int& spin, | ||
const int& nkb, | ||
const int& deeq_x, | ||
const int& deeq_y, | ||
const int& deeq_z, | ||
const FPTYPE* deeq, | ||
std::complex<FPTYPE>* ps, | ||
const std::complex<FPTYPE>* becp); | ||
}; | ||
#endif // __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM | ||
} // namespace hamilt | ||
#endif //MODULE_HAMILT_NONLOCAL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.