Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace modify the functions form cu files to cpp files #4245

Merged
merged 45 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
44ac153
replace ParaV in module gint
A-006 May 6, 2024
5c29f8c
Merge branch 'develop' into replace
A-006 May 6, 2024
0e360ee
Merge branch 'deepmodeling:develop' into replace
A-006 May 7, 2024
43fbbd4
change PV to pv in module gint
A-006 May 7, 2024
e53b13c
Merge branch 'deepmodeling:develop' into replace
A-006 May 11, 2024
1ad5d87
Merge branch 'deepmodeling:develop' into replace
A-006 May 13, 2024
3a67c2b
change GlobalC in module gint
A-006 May 13, 2024
e50ee79
fix LCAO_Orbitals in module gint
A-006 May 13, 2024
83ebe2e
fix error in compile without abacus
A-006 May 13, 2024
b96a678
Merge branch 'deepmodeling:develop' into replace
A-006 May 13, 2024
ff3e262
fix error in init_gpu_gint_variables
A-006 May 13, 2024
7d06aa2
remove GlobalC in grid_technique and grid_bigcell
A-006 May 13, 2024
da3522c
remove GlobalC in gint_tools and vbatch matrix
A-006 May 13, 2024
030217b
Merge branch 'deepmodeling:develop' into replace
A-006 May 14, 2024
4bbbdf3
Merge branch 'develop' into replace
A-006 May 14, 2024
82d9843
Merge branch 'develop' into replace
A-006 May 15, 2024
4e5e256
Merge branch 'develop' into replace
mohanchen May 20, 2024
5366d50
Merge branch 'develop' into replace
A-006 May 21, 2024
15e79e1
Merge branch 'deepmodeling:develop' into replace
A-006 May 21, 2024
939ed76
fix relax have compute stress and change GPU force compute to acclerate
A-006 May 21, 2024
01bde3e
fix num stream in input.md and use num_stream in input
A-006 May 21, 2024
49d6256
Merge branch 'deepmodeling:develop' into replace
A-006 May 22, 2024
4e44406
Merge branch 'deepmodeling:develop' into replace
A-006 May 22, 2024
6ebb7a3
fix error in compute force
A-006 May 22, 2024
db894e4
Merge branch 'develop' into replace
mohanchen May 22, 2024
07de464
Merge branch 'develop' into replace
A-006 May 23, 2024
fbd2f7b
fix memory error in force compute
A-006 May 23, 2024
c0e9990
use std instead of double * and add const
A-006 May 24, 2024
7d7a0b5
Merge branch 'deepmodeling:develop' into replace
A-006 May 24, 2024
20f60ab
fix error in vector use
A-006 May 24, 2024
b9a69cd
Merge branch 'develop' into replace
A-006 May 24, 2024
8626c7a
fix error in compile
A-006 May 24, 2024
5a81037
fix error in compile with force
A-006 May 24, 2024
cfae1f6
fix compile error
A-006 May 24, 2024
6c6f274
Merge branch 'develop' into replace
mohanchen May 25, 2024
c9ad0ee
Merge branch 'develop' into replace
A-006 May 26, 2024
8929180
fix paramter name and function name
A-006 May 26, 2024
7056269
add time ticker and fix nspin transport
A-006 May 26, 2024
7ccc51f
delete printf in files
A-006 May 26, 2024
60b1b4d
fix test bug and fix grid_size
A-006 May 26, 2024
5359609
init nstreams
A-006 May 27, 2024
7340726
Merge branch 'develop' into replace
A-006 May 27, 2024
25d40d1
move cpp function from cu file to cpp file
A-006 May 27, 2024
6541664
Merge branch 'develop' into replace
A-006 May 27, 2024
8b409df
Merge branch 'develop' into replace
mohanchen May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/module_hamilt_lcao/module_gint/gint_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ void allocateDm(double* matrix_host,
void para_init(grid_para& para,
const int iter_num,
const int nbz,
const int pipeline_index,
mohanchen marked this conversation as resolved.
Show resolved Hide resolved
const Grid_Technique& gridt);
/**
* @brief frc_strs_iat on host and device Init
Expand Down Expand Up @@ -224,6 +225,7 @@ void cal_init(frc_strs_iat& f_s_iat,
void para_mem_copy(grid_para& para,
const Grid_Technique& gridt,
const int nbz,
const int pipeline_index,
const int atom_num_grid);
/**
* @brief Force Stress Force Iat memCpy,from Host to Device
Expand Down
19 changes: 11 additions & 8 deletions source/module_hamilt_lcao/module_gint/gint_force_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void gint_fvl_gamma_gpu(hamilt::HContainer<double>* dm,
const int cuda_block
= std::min(64, (gridt.psir_size + cuda_threads - 1) / cuda_threads);
int iter_num = 0;
int pipeline_index = 0;
DensityMat denstiy_mat;
frc_strs_iat_gbl f_s_iat_dev;
grid_para para;
Expand Down Expand Up @@ -112,9 +113,10 @@ void gint_fvl_gamma_gpu(hamilt::HContainer<double>* dm,
dim3 grid_dot(cuda_block);
dim3 block_dot(cuda_threads);

para_init(para, iter_num, nbz, gridt);
pipeline_index = iter_num % gridt.nstreams;
para_init(para, iter_num, nbz, pipeline_index,gridt);
cal_init(f_s_iat,
para.stream_num,
pipeline_index,
cuda_block,
atom_num_grid,
max_size,
Expand All @@ -141,19 +143,20 @@ void gint_fvl_gamma_gpu(hamilt::HContainer<double>* dm,
para_mem_copy(para,
gridt,
nbz,
pipeline_index,
atom_num_grid);
cal_mem_cpy(f_s_iat,
gridt,
atom_num_grid,
cuda_block,
para.stream_num);
checkCuda(cudaStreamSynchronize(gridt.streams[para.stream_num]));
pipeline_index);
checkCuda(cudaStreamSynchronize(gridt.streams[pipeline_index]));
/* cuda stream compute and Multiplication of multinomial matrices */

get_psi_force<<<grid_psi,
block_psi,
0,
gridt.streams[para.stream_num]>>>(
gridt.streams[pipeline_index]>>>(
gridt.ylmcoef_g,
dr,
gridt.bxyz,
Expand Down Expand Up @@ -192,14 +195,14 @@ void gint_fvl_gamma_gpu(hamilt::HContainer<double>* dm,
para.matrix_C_device,
para.ldc_device,
atom_pair_num,
gridt.streams[para.stream_num],
gridt.streams[pipeline_index],
nullptr);
/* force compute in GPU */
if (isforce){
dot_product_force<<<grid_dot_force,
block_dot_force,
0,
gridt.streams[para.stream_num]>>>(
gridt.streams[pipeline_index]>>>(
para.psir_lx_device,
para.psir_ly_device,
para.psir_lz_device,
Expand All @@ -215,7 +218,7 @@ void gint_fvl_gamma_gpu(hamilt::HContainer<double>* dm,
dot_product_stress<<<grid_dot,
block_dot,
0,
gridt.streams[para.stream_num]>>>(
gridt.streams[pipeline_index]>>>(
para.psir_lxx_device,
para.psir_lxy_device,
para.psir_lxz_device,
Expand Down
Loading