Adding fphi_uind kernel, working on the arrays allocation

This commit is contained in:
Trung Nguyen
2022-08-29 00:13:30 -05:00
parent 9e7bbad4d4
commit c5c3c697df
4 changed files with 279 additions and 6 deletions

View File

@ -453,14 +453,14 @@ void BaseAmoebaT::precompute_induce(const int inum_full, const int bsorder,
_thetai1.alloc(_max_thetai_size*bsorder*4,*(this->ucl_device),UCL_READ_WRITE,UCL_READ_WRITE);
_thetai2.alloc(_max_thetai_size*bsorder*4,*(this->ucl_device),UCL_READ_WRITE,UCL_READ_WRITE);
_thetai3.alloc(_max_thetai_size*bsorder*4,*(this->ucl_device),UCL_READ_WRITE,UCL_READ_WRITE);
_igrid.alloc(_max_thetai_size*3,*(this->ucl_device),UCL_READ_WRITE,UCL_READ_WRITE);
_igrid.alloc(_max_thetai_size,*(this->ucl_device),UCL_READ_WRITE,UCL_READ_WRITE);
} else {
if (inum_full>_max_thetai_size) {
_max_thetai_size=static_cast<int>(static_cast<double>(inum_full)*1.10);
_thetai1.resize(_max_thetai_size*bsorder*4);
_thetai2.resize(_max_thetai_size*bsorder*4);
_thetai3.resize(_max_thetai_size*bsorder*4);
_igrid.resize(_max_thetai_size*4);
_igrid.resize(_max_thetai_size);
}
}
@ -471,7 +471,7 @@ void BaseAmoebaT::precompute_induce(const int inum_full, const int bsorder,
_thetai1.update_device(inum_full*bsorder*4,true);
_thetai2.update_device(inum_full*bsorder*4,true);
_thetai3.update_device(inum_full*bsorder*4,true);
_igrid.update_device(inum_full*4,true);
_igrid.update_device(inum_full,true);
}
// ---------------------------------------------------------------------------
@ -593,12 +593,17 @@ template <class numtyp, class acctyp>
void BaseAmoebaT::compute_fphi_uind(const int inum_full, const int bsorder,
double **host_thetai1, double **host_thetai2,
double **host_thetai3, int** igrid,
double ****host_grid, double **host_fdip_phi1,
double ****host_cgrid_brick, double **host_fdip_phi1,
double **host_fdip_phi2, double **host_fdip_sum_phi)
{
// once allocation and transfers
precompute_induce(inum_full, bsorder, host_thetai1, host_thetai2, host_thetai3, igrid);
// resize grid if needed, then copy from host to device
// cgrid_brick.alloc()/resize()
// cgrid_brick.begin() = host_cgrid_brick[0][0][0][0];
//
const int red_bllocks = fphi_uind();
}