52 const Real* dev_dxdydz,
55 const uint
ti = threadIdx.x;
60 smallest[
ti] = numeric_limits<Real>::max();
63 const uint thisVmeshSize = thisVmesh->size();
68 const Real EPS = numeric_limits<Real>::min() * 1000;
71 for (uint blockIndex =
ti/2; blockIndex < thisVmeshSize; blockIndex +=
blockSize/2) {
72 if (blockIndex < thisVmeshSize) {
74 thisVmesh->getBlockInfo(GID,blockInfo);
77 const int i = (
ti % 2) * (
WID-1);
79 const Real Vx = blockInfo[0] + (
i +
HALF) * blockInfo[3] +
EPS;
80 const Real Vy = blockInfo[1] + (
i +
HALF) * blockInfo[4] +
EPS;
81 const Real Vz = blockInfo[2] + (
i +
HALF) * blockInfo[5] +
EPS;
82 smallest[
ti] =
min({
dx / fabs(Vx), dy / fabs(Vy), dz / fabs(Vz), smallest[
ti]});
87 for (
unsigned int s=
blockSize/2; s>0; s>>=1) {
89 smallest[
ti] =
min(smallest[
ti],smallest[
ti + s]);
105 const vector<CellID>& cells,
106 Real (&dtMaxLocal)[3]) {
108 phiprof::Timer computeGpuTimestepTimer {
"compute-vlasov-gpu-timestep"};
110 const uint nAllCells = cells.size();
129 #pragma omp parallel for schedule(static)
130 for(uint celli = 0; celli < nAllCells; celli++){
134 for (uint popID = 0; popID < nPOP; ++popID) {
145 reduce_v_dt_kernel<<<nAllCells, GPUTHREADS*WARPSPERBLOCK, 0, 0>>> (
155 #pragma omp parallel for schedule(static)
156 for(uint celli = 0; celli < nAllCells; celli++){
158 for (uint popID = 0; popID < nPOP; ++popID) {
159 cell->
set_max_r_dt(popID, host_max_dt[celli*nPOP + popID]);
163 computeGpuTimestepTimer.stop();
168 phiprof::Timer computeRestTimestepTimer {
"compute-vlasov-rest-timestep"};
169 for (vector<CellID>::const_iterator cell_id = cells.begin(); cell_id != cells.end(); ++cell_id) {
185 computeRestTimestepTimer.stop();
ObjectWrapper & getObjectWrapper()