Feb2021 GPU Package Update - GPU Package Files

This commit is contained in:
Michael Brown
2021-02-15 08:20:50 -08:00
parent 16004e8f45
commit e7e2d2323b
345 changed files with 13424 additions and 7708 deletions

View File

@ -71,7 +71,7 @@ grdtyp * PPPMT::init(const int nlocal, const int nall, FILE *_screen,
if (flag!=0)
return 0;
if (sizeof(grdtyp)==sizeof(double) && device->double_precision()==false) {
flag=-5;
flag=-15;
return 0;
}
if (device->ptx_arch()>0.0 && device->ptx_arch()<1.1) {
@ -133,7 +133,7 @@ grdtyp * PPPMT::init(const int nlocal, const int nall, FILE *_screen,
UCL_SUCCESS);
UCL_H_Vec<grdtyp> view;
view.view(rho_coeff[0]+n2lo,numel,*ucl_device);
ucl_copy(d_rho_coeff,view,true);
ucl_copy(d_rho_coeff,view,false);
_max_bytes+=d_rho_coeff.row_bytes();
// Allocate storage for grid
@ -191,6 +191,7 @@ void PPPMT::clear(const double cpu_time) {
d_brick_counts.clear();
error_flag.clear();
d_brick_atoms.clear();
d_rho_coeff.clear();
acc_timers();
device->output_kspace_times(time_in,time_out,time_map,time_rho,time_interp,
@ -261,7 +262,7 @@ void PPPMT::_precompute(const int ago, const int nlocal, const int nall,
double delvolinv = delxinv*delyinv*delzinv;
grdtyp f_delvolinv = delvolinv;
device->zero(d_brick_counts,d_brick_counts.numel());
d_brick_counts.zero();
k_particle_map.set_size(GX,BX);
k_particle_map.run(&atom->x, &atom->q, &f_delvolinv, &ainum,
&d_brick_counts, &d_brick_atoms, &_brick_x, &_brick_y,
@ -286,6 +287,10 @@ void PPPMT::_precompute(const int ago, const int nlocal, const int nall,
error_flag.update_host(true);
time_out.stop();
#ifndef GERYON_OCL_FLUSH
error_flag.flush();
#endif
_precompute_done=true;
}
@ -351,7 +356,7 @@ void PPPMT::interp(const grdtyp qqrd2e_scale) {
&ans->force);
time_interp.stop();
ans->copy_answers(false,false,false,false);
ans->copy_answers(false,false,false,false,0);
if (_kspace_split==false)
device->add_ans_object(ans);
}
@ -374,18 +379,19 @@ void PPPMT::compile_kernels(UCL_Device &dev) {
#ifdef USE_OPENCL
flags+=std::string(" -Dgrdtyp=")+ucl_template_name<grdtyp>()+" -Dgrdtyp4="+
ucl_template_name<grdtyp>()+"4";
if (sizeof(grdtyp)==sizeof(double)) flags+=std::string(" -DGRD_DBL");
#endif
if (pppm_program) delete pppm_program;
pppm_program=new UCL_Program(dev);
#ifdef USE_OPENCL
pppm_program->load_string(pppm,flags.c_str());
pppm_program->load_string(pppm,flags.c_str(),nullptr,screen);
#else
if (sizeof(grdtyp)==sizeof(float))
pppm_program->load_string(pppm_f,flags.c_str());
pppm_program->load_string(pppm_f,flags.c_str(),nullptr,screen);
else
pppm_program->load_string(pppm_d,flags.c_str());
pppm_program->load_string(pppm_d,flags.c_str(),nullptr,screen);
#endif
k_particle_map.set_function(*pppm_program,"particle_map");