35#define BANK_OFFSET(n) \
36 ((n) >> (LOG_BANKS) + (n) >> (2 * LOG_BANKS))
39#define BANK_OFFSET(n) 0
67 const uint flatExtent,
73 split::SplitVector<Hashinator::hash_pair<vmesh::GlobalID,vmesh::LocalID>>* *lists_delete,
74 split::SplitVector<Hashinator::hash_pair<vmesh::GlobalID,vmesh::LocalID>>* *lists_to_replace,
75 split::SplitVector<Hashinator::hash_pair<vmesh::GlobalID,vmesh::LocalID>>* *lists_with_replace_old,
77 split::SplitVector<vmesh::GlobalID> ** dev_vbwcl_vec,
81 const size_t ind = blockIdx.x * blockDim.x + threadIdx.x;
84 const size_t nTot = Dacc*Dother;
90 probeFlattened[ind] = 0;
93 probeFlattened[ind] = invalidLID;
103 dev_vbwcl_vec[
cellOffset]->device_resize(nBlocks,
false);
121 const size_t VBC_size = blockContainer->
size() *
WID3;
124 const size_t ind = blockIdx.x * blockDim.x + threadIdx.x;
125 for (
size_t i = ind;
i < VBC_size;
i += gridDim.x * blockDim.x) {
166 const uint flatExtent,
167 const uint* __restrict__ gpu_block_indices_to_probe,
171 const int ti = threadIdx.x;
178 if (LID >= nBlocks) {
186 vmesh->getIndices(GID,indices[0],indices[1],indices[2]);
189 const int target = indices[0] * gpu_block_indices_to_probe[0]
190 + indices[1] * gpu_block_indices_to_probe[1]
191 + indices[2] * gpu_block_indices_to_probe[2];
193 probeCube[target] = LID;
222 const size_t flatExtent,
229 const int ti = threadIdx.x;
243 if (probeCube[
j*Dother + ind] == invalidLID) {
264 probeFlattened[ind] = foundCols;
265 probeFlattened[flatExtent + ind] = foundBlocks;
311 const size_t flatExtent,
328 const int n = 2*Hashinator::defaults::MAX_BLOCKSIZE;
329 __shared__
vmesh::LocalID reductionA[2*Hashinator::defaults::MAX_BLOCKSIZE];
330 __shared__
vmesh::LocalID reductionB[2*Hashinator::defaults::MAX_BLOCKSIZE];
331 __shared__
vmesh::LocalID reductionC[2*Hashinator::defaults::MAX_BLOCKSIZE];
336 const int ti = threadIdx.x;
344 size_t majorOffset = 0;
347 while ((majorOffset < flatExtent) && (offsetC<nBlocks)) {
354 reductionA[ai + bankOffsetA] = probeFlattened[majorOffset + ai];
355 reductionA[bi + bankOffsetB] = probeFlattened[majorOffset + bi];
356 reductionB[ai + bankOffsetA] = (probeFlattened[majorOffset + ai] != 0 ? 1 : 0);
357 reductionB[bi + bankOffsetB] = (probeFlattened[majorOffset + bi] != 0 ? 1 : 0);
358 reductionC[ai + bankOffsetA] = probeFlattened[flatExtent + majorOffset + ai];
359 reductionC[bi + bankOffsetB] = probeFlattened[flatExtent + majorOffset + bi];
362 for (
int d = n>>1; d > 0; d >>= 1) {
365 int ai = offset*(2*
ti+1)-1;
366 int bi = offset*(2*
ti+2)-1;
369 reductionA[bi] += reductionA[ai];
370 reductionB[bi] += reductionB[ai];
371 reductionC[bi] += reductionC[ai];
383 for (
int d = 1; d < n; d *= 2) {
387 int ai = offset*(2*
ti+1)-1;
388 int bi = offset*(2*
ti+2)-1;
393 reductionA[ai] = reductionA[bi];
396 reductionB[ai] = reductionB[bi];
399 reductionC[ai] = reductionC[bi];
414 probeFlattened[2*flatExtent + majorOffset + ai] = reductionA[ai + bankOffsetA] + offsetA;
415 probeFlattened[2*flatExtent + majorOffset + bi] = reductionA[bi + bankOffsetB] + offsetA;
416 probeFlattened[3*flatExtent + majorOffset + ai] = reductionB[ai + bankOffsetA] + offsetB;
417 probeFlattened[3*flatExtent + majorOffset + bi] = reductionB[bi + bankOffsetB] + offsetB;
418 probeFlattened[4*flatExtent + majorOffset + ai] = reductionC[ai + bankOffsetA] + offsetC;
419 probeFlattened[4*flatExtent + majorOffset + bi] = reductionC[bi + bankOffsetB] + offsetC;
425 offsetA += reductionA[n-1] + probeFlattened[majorOffset-1];
426 offsetB += reductionB[n-1] + (probeFlattened[majorOffset-1] != 0 ? 1 : 0);
427 offsetC += reductionC[n-1] + probeFlattened[flatExtent + majorOffset-1];
441 if ( (
columnData->dev_capacityCols() < numCols) ||
442 (
columnData->dev_capacityColSets() < numColSets) ) {
448 columnData->device_setSizes(numCols,numColSets);
493 const size_t flatExtent,
496 split::SplitVector<vmesh::GlobalID> ** dev_vbwcl_vec,
503 const int ti = threadIdx.x;
519 const vmesh::LocalID offset_cols = probeFlattened[2*flatExtent + ind];
520 const vmesh::LocalID offset_colsets = probeFlattened[3*flatExtent + ind];
521 const vmesh::LocalID offset_blocks = probeFlattened[4*flatExtent + ind];
552 assert(
"ERROR! incorrect dimension!\n");
558 columnData->setColumnOffsets[offset_colsets] = offset_cols;
559 columnData->setNumColumns[offset_colsets] = N_cols;
570 if (foundCols >= N_cols) {
574 if (LID == invalidLID) {
578 columnData->columnNumBlocks[offset_cols + foundCols] = foundBlocksThisCol;
585 LIDlist[offset_blocks + foundBlocks] = LID;
589 foundBlocksThisCol = 0;
590 columnData->columnBlockOffsets[offset_cols + foundCols] = offset_blocks + foundBlocks;
596 foundBlocksThisCol++;
601 columnData->columnNumBlocks[offset_cols + foundCols] = foundBlocksThisCol;
668 const uint* __restrict__ gpu_cell_indices_to_id,
669 split::SplitVector<vmesh::GlobalID> ** dev_vbwcl_vec,
675 const uint
ti = threadIdx.z*blockDim.x*blockDim.y + threadIdx.y*blockDim.x + threadIdx.x;
677 const uint sourcei = threadIdx.x*gpu_cell_indices_to_id[0]
678 + threadIdx.y*gpu_cell_indices_to_id[1]
679 + threadIdx.z*gpu_cell_indices_to_id[2];
681 const uint iColumn = blockIdx.x;
696 const uint inputOffset =
columnData->columnBlockOffsets[iColumn];
697 const uint outputOffset = (inputOffset + 2 * iColumn) *
WID3;
698 const uint columnLength =
columnData->columnNumBlocks[iColumn];
701 for (uint b = 0; b < columnLength; b++) {
703 assert((inputOffset + b) < blockContainer->size() &&
"reorder_blocks_by_dimension_kernel too large LID");
706 const Realf* __restrict__ gpu_blockData = blockContainer->getData(LID);
708 gpu_blockDataOrdered[outputOffset + (1 + b) *
WID3 +
ti] = gpu_blockData[sourcei];
711 gpu_blockDataOrdered[outputOffset +
ti] = 0.0;
712 gpu_blockDataOrdered[outputOffset + (columnLength + 1) *
WID3 +
ti] = 0.0;
747 const uint dimension,
762 const uint warpSize = blockDim.x;
764 const uint
ti = threadIdx.x;
786 for(uint tti = 0; tti < MAX_BLOCKS_PER_DIM; tti += warpSize ) {
787 const uint index = tti + ti;
788 if (index < MAX_BLOCKS_PER_DIM) {
789 isTargetBlock[index] = 0;
790 isSourceBlock[index] = 0;
804 Realf intersectionMins[4];
814 Realf min_intersectionMin = std::min(std::min(intersectionMins[0],intersectionMins[1]),
815 std::min(intersectionMins[2],intersectionMins[3]));
816 Realf max_intersectionMin = std::max(std::max(intersectionMins[0],intersectionMins[1]),
817 std::max(intersectionMins[2],intersectionMins[3]));
841 const int firstBlock_gk = (int)((firstBlockMinV - max_intersectionMin)/
intersection_dk);
842 const int lastBlock_gk = (int)((lastBlockMaxV - min_intersectionMin)/
intersection_dk);
844 int firstBlockIndexK = firstBlock_gk/
WID;
845 int lastBlockIndexK = lastBlock_gk/
WID;
849 firstBlockIndexK = (firstBlockIndexK >= 0) ? firstBlockIndexK : 0;
851 lastBlockIndexK = (lastBlockIndexK >= 0) ? lastBlockIndexK : 0;
865 for (uint blockK = kBegin; blockK <= kEnd; blockK +=warpSize){
866 if ((blockK+
ti) <= kEnd) {
873 for (uint blockK = (uint)firstBlockIndexK; blockK <= (
uint)lastBlockIndexK; blockK+=warpSize){
874 if ((blockK+
ti) <= (uint)lastBlockIndexK) {
882 columnData->minBlockK[columnIndex] = firstBlockIndexK;
883 columnData->maxBlockK[columnIndex] = lastBlockIndexK;
889 const uint blockK = blockT +
ti;
893 const int targetBlock =
901 const int targetBlock =
911 const int targetBlock =
924#if THREADS_PER_MP < (REGISTERS_PER_MP/64 + 1)
925 #define ACCELERATION_KERNEl_MIN_BLOCKS THREADS_PER_MP/(WID3)
927 #define ACCELERATION_KERNEl_MIN_BLOCKS (REGISTERS_PER_MP/64)/(WID3)
957 const uint* __restrict__ gpu_cell_indices_to_id,
964 const Real *dev_minValues,
965 const size_t invalidLID,
973 const int i = threadIdx.x;
974 const int j = threadIdx.y;
975 const int k = threadIdx.z;
976 const int ij = threadIdx.x + threadIdx.y * blockDim.x;
977 const int ti = ij +
k*blockDim.x*blockDim.y;
992 __shared__
Realf minValue;
993 __shared__ uint setColumnOffset;
994 __shared__ uint numColumns;
1016 for (uint columnIndex = 0;
1017 columnIndex < numColumns;
1020 const uint column = setColumnOffset + columnIndex;
1023 const int nBlocks =
columnData->columnNumBlocks[column];
1027 const int col_mink =
columnData->minBlockK[column];
1028 const int col_maxk =
columnData->maxBlockK[column];
1029 const size_t stencilDataOffset = (
columnData->columnBlockOffsets[column] + 2*column) *
WID3;
1035 const Realf intersection_min =
1040 const int target_cell_index_common =
i * gpu_cell_indices_to_id[0]
1041 +
j * gpu_cell_indices_to_id[1];
1044 for (
int b = 0; b < nBlocks; b++) {
1045 const int blockOffset =
WID * b;
1051 const Realf min_lagrangian_v_l = v_r0 + blockOffset *
dv;
1052 const Realf max_lagrangian_v_r = v_r0 + (blockOffset +
WID) *
dv;
1055 const int subcolumnMinGk = int(trunc((min_lagrangian_v_l - intersection_min)/
intersection_dk));
1056 const int subcolumnMaxGk = int(trunc((max_lagrangian_v_r - intersection_min)/
intersection_dk));
1060 minGk = std::max(subcolumnMinGk, col_mink *
WID) - (
WID-1);
1061 const int maxGk = std::min(subcolumnMaxGk, (col_maxk + 1) *
WID - 1);
1067 int val = maxGk - minGk + 1;
1069 for (
int offset =
GPUTHREADS/2; offset > 0; offset /= 2) {
1073 if (indexInsideWarp == 0) {
1074 loopN[warpIndex] = val;
1079 if (warpIndex == 0) {
1080 val = (indexInsideWarp <
WID3/
GPUTHREADS) ? loopN[indexInsideWarp] : INT_MIN;
1081 for (
int offset =
GPUTHREADS/2; offset > 0; offset /= 2) {
1085 if (indexInsideWarp == 0) {
1094 const Realf v_l = v_r0 + (blockOffset +
k) *
dv;
1095 const Realf v_r = v_r0 + (blockOffset +
k + 1) *
dv;
1097 const int lagrangian_gk_l = std::trunc((v_l-intersection_min)/
intersection_dk);
1098 const int lagrangian_gk_r = std::trunc((v_r-intersection_min)/
intersection_dk);
1102 const size_t valuesOffset = stencilDataOffset + (b + 1) *
WID3;
1103#ifdef ACC_SEMILAG_PLM
1107#ifdef ACC_SEMILAG_PPM
1111#ifdef ACC_SEMILAG_PQM
1121 for(
int loopgk = 0; loopgk < loopN[0]; loopgk++) {
1123 const int gk = minGk + loopgk +
k;
1125 if (gk >= lagrangian_gk_l && gk <= lagrangian_gk_r) {
1126 const int blockK = gk/
WID;
1127 const int gk_mod_WID = (gk - blockK *
WID);
1132 const Realf v_norm_r = ( std::min( std::max( (gk + 1) *
intersection_dk + intersection_min, v_l), v_r) - v_l) * i_dv;
1135 const Realf target_density_l = target_density_r;
1138 #ifdef ACC_SEMILAG_PLM
1139 target_density_r = a[1];
1140 target_density_r = a[0] + v_norm_r * target_density_r;
1141 target_density_r = v_norm_r * target_density_r;
1143 #ifdef ACC_SEMILAG_PPM
1144 target_density_r = a[2];
1145 target_density_r = a[1] + v_norm_r * target_density_r;
1146 target_density_r = a[0] + v_norm_r * target_density_r;
1147 target_density_r = v_norm_r * target_density_r;
1149 #ifdef ACC_SEMILAG_PQM
1150 target_density_r = a[4];
1151 target_density_r = a[3] + v_norm_r * target_density_r;
1152 target_density_r = a[2] + v_norm_r * target_density_r;
1153 target_density_r = a[1] + v_norm_r * target_density_r;
1154 target_density_r = a[0] + v_norm_r * target_density_r;
1155 target_density_r = v_norm_r * target_density_r;
1161 Realf tval = target_density_r - target_density_l;
1167 const int tcell = target_cell_index_common
1168 + gk_mod_WID * gpu_cell_indices_to_id[2];
1170 if (isfinite(tval) && (tval>(
Realf)(0.0)) && (targetLID != invalidLID) ) {
1175 atomicAdd(&gpu_blockData[targetLID*
WID3+tcell],tval);
1213 dccrg::Dccrg<spatial_cell::SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid,
1214 vector<CellID> &launchCells,
1216 const uint dimension,
1222 phiprof::Timer prepTimer {
"preparation"};
1267 string message =
" ERROR! vmesh::LocalID and vmesh::GlobalID are of different sizes, and thus";
1268 message +=
" the acceleration solver cannot safely use the spatial_cell->dev_list_delete";
1269 message +=
" Hashinator::splitVector object for storing a list of LIDs.";
1270 bailout(
true, message, __FILE__, __LINE__);
1273 const uint nLaunchCells = launchCells.size();
1274 size_t largestSizePower = 0;
1275 size_t largestNBefore = 0;
1283 largestSizePower = std::max(largestSizePower, (
size_t)SC->
vbwcl_sizePower);
1284 largestSizePower = std::max(largestSizePower, (
size_t)SC->
vbwncl_sizePower);
1289 phiprof::Timer clearTimer {
"clear and prepare probe buffers"};
1303 const size_t n_prefill = 1 + ((probeCombinedSize - 1) / Hashinator::defaults::MAX_BLOCKSIZE);
1305 const dim3 grid_prefill_probe(n_prefill,nLaunchCells,1);
1326 phiprof::Timer fillTimer {
"fill probe cube"};
1329 const size_t n_fill_ord = 1 + ((largestNBefore - 1) / Hashinator::defaults::MAX_BLOCKSIZE);
1330 const dim3 grid_fill_ord(n_fill_ord,nLaunchCells,1);
1345 phiprof::Timer flattenTimer {
"flatten probe cube"};
1346 const size_t n_grid_cube = 1 + ((Dother - 1) / Hashinator::defaults::MAX_BLOCKSIZE);
1347 const dim3 grid_cube(n_grid_cube,nLaunchCells,1);
1358 flattenTimer.stop();
1375 phiprof::Timer scanTimer {
"scan probe cube"};
1376 const dim3 grid_scan(1,nLaunchCells,1);
1399 phiprof::Timer allocTimer {
"ensure allocations"};
1407 largest_totalColumns = std::max(largest_totalColumns,host_totalColumns);
1408 largest_totalColumnSets = std::max(largest_totalColumnSets,host_totalColumnSets);
1409 if (host_recapacitateVectors) {
1419 phiprof::Timer columnsTimer {
"build columns"};
1434 columnsTimer.stop();
1436 phiprof::Timer allocTimer2 {
"ensure vlasov allocations"};
1456 phiprof::Timer reorderTimer {
"reorder blocks"};
1457 const dim3 grid_reorder(largest_totalColumns,nLaunchCells,1);
1459 reorder_blocks_by_dimension_kernel<<<grid_reorder, block_reorder, 0, baseStream>>> (
1470 reorderTimer.stop();
1474 phiprof::Timer extentsTimer {
"column extents"};
1480 const dim3 grid_column_extents(largest_totalColumnSets,nLaunchCells,1);
1481 evaluate_column_extents_kernel<<<grid_column_extents, GPUTHREADS, 0, baseStream>>> (
1502 extentsTimer.stop();
1504 phiprof::Timer extents2Timer {
"column extents 2"};
1505 bool needSecondLaunchColumnExtents =
false;
1511 needSecondLaunchColumnExtents =
true;
1522 if (needSecondLaunchColumnExtents) {
1529 evaluate_column_extents_kernel<<<grid_column_extents, GPUTHREADS, 0, baseStream>>> (
1551 extents2Timer.stop();
1559 string message =
"Some target blocks in acceleration are going to be less than ";
1561 message +=
" blocks away from the current velocity space walls for population ";
1563 message +=
" at CellID ";
1565 message +=
". Consider expanding velocity space for that population.";
1566 bailout(
true, message, __FILE__, __LINE__);
1570 string message =
"Recapacitation of added velocity blocks vector for population ";
1571 message +=
" blocks away from the current velocity space walls for population ";
1573 message +=
" at CellID ";
1575 message +=
" failed. This should not happen.";
1576 bailout(
true, message, __FILE__, __LINE__);
1584 phiprof::Timer extractTimer {
"extract block adjust vectors"};
1620 extractTimer.stop();
1625 phiprof::Timer adjustTimer {
"block adjust caller"};
1626 uint largestBlocksToChange;
1627 uint largestBlocksBeforeOrAfter;
1632 largestBlocksToChange,
1633 largestBlocksBeforeOrAfter,
1641 phiprof::Timer alloc2Timer {
"ensure allocations 2"};
1648 largest_nAfter = std::max(largest_nAfter,nBlocksAfterAdjust);
1657 phiprof::Timer zeroTimer {
"zero target data"};
1658 const size_t n_fill_VBC_zero = 1 + ((largest_nAfter*
WID3 - 1) / Hashinator::defaults::MAX_BLOCKSIZE);
1659 const dim3 grid_fill_VBC_zero(n_fill_VBC_zero,nLaunchCells,1);
1669 phiprof::Timer accTimer {
"acceleration kernel"};
1670 const dim3 grid_acc(largest_totalColumnSets,nLaunchCells,1);
1672 acceleration_kernel<<<grid_acc, block_acc, 0, baseStream>>> (
#define gpuPeekAtLastError
#define gpuStreamSynchronize
#define gpuMemcpyHostToDevice
#define gpuMemcpyDeviceToHost
#define gpuKernelShflDown(val, offset)
vmesh::LocalID get_number_of_velocity_blocks(const uint popID) const
vmesh::VelocityMesh * get_velocity_mesh(const size_t &popID)
vmesh::LocalID vbwncl_sizePower
split::SplitVector< vmesh::GlobalID > * list_with_replace_new
vmesh::LocalID getReservation(const uint popID) const
vmesh::LocalID vbwcl_sizePower
void applyReservation(const uint popID)
std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > parameters
void setReservation(const uint popID, const vmesh::LocalID reservationsize, bool force=false)
ARCH_HOSTDEV vmesh::LocalID size() const
ARCH_HOSTDEV Realf * getData()
const vmesh::LocalID * getGridLength() const
static vmesh::LocalID invalidLocalID()
const Real * getMeshMinLimits() const
const Real * getCellSize() const
size_t size(bool dummy=0) const
void bailout(const bool condition, const std::string &message, const char *const file, const int line)
A function to stop the simulation if the boolean condition is true. Raises a flag which gets MPI_Redu...
#define MAX_BLOCKS_PER_DIM
static void compute_plm_coeff(const Vec *const values, const uint k, Vec a[2], const Realf threshold)
static void compute_ppm_coeff(const Vec *const values, const face_estimate_order order, const uint k, Vec a[3], const Realf threshold)
static void compute_pqm_coeff(const Vec *__restrict__ values, face_estimate_order order, uint k, Vec a[5], const Realf threshold)
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets * dev_columnOffsetData
__global__ void fill_VBC_zero_kernel(vmesh::VelocityBlockContainer **blockContainers, const uint cumulativeOffset)
__global__ void prefill_probe_kernel(vmesh::VelocityMesh **__restrict__ vmeshes, vmesh::LocalID *dev_probeCubeData, const uint flatExtent, const size_t Dacc, const size_t Dother, const vmesh::LocalID invalidLID, split::SplitVector< vmesh::GlobalID > **lists_with_replace_new, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **lists_delete, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **lists_to_replace, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **lists_with_replace_old, split::SplitVector< vmesh::GlobalID > **dev_vbwcl_vec, const uint cumulativeOffset, const size_t gpu_probeStride)
GPU kernel which fills the target probe cube with the invalid value for vmesh::LocalID.
const Realf intersection_dk
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > ** lists_with_replace_new
Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > * dev_map_remove
__global__ void vmesh::VelocityMesh **__restrict__ vmeshes
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ gpu_block_indices_to_id
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int const int const Realf const Realf vmesh::LocalID vmesh::LocalID const uint cumulativeOffset
__shared__ int isTargetBlock[MAX_BLOCKS_PER_DIM]
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int const int const Realf const Realf vmesh::LocalID vmesh::LocalID * dev_overflownElements
__global__ void build_column_offsets(vmesh::VelocityMesh **__restrict__ vmeshes, vmesh::LocalID *dev_probeCubeData, const vmesh::LocalID D0, const vmesh::LocalID D1, const vmesh::LocalID D2, const int dimension, const size_t flatExtent, const vmesh::LocalID invalidLID, ColumnOffsets *dev_columnOffsetData, split::SplitVector< vmesh::GlobalID > **dev_vbwcl_vec, const uint cumulativeOffset, const size_t gpu_probeStride)
GPU kernel for building the columns and columnSets for each spatial cell, and storing offsets and len...
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int const int const Realf v_min
const Realf intersection_di
__global__ void fill_probe_ordered(vmesh::VelocityMesh **__restrict__ vmeshes, vmesh::LocalID *dev_probeCubeData, const uint flatExtent, const uint *__restrict__ gpu_block_indices_to_probe, const uint cumulativeOffset, const size_t gpu_probeStride)
GPU kernel for taking the contents of a vmesh and placign the existing velocity blocks in a probe cub...
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int const int const Realf const Realf dv
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > ** allMaps
__global__ void scan_probe(vmesh::VelocityMesh **__restrict__ vmeshes, vmesh::LocalID *dev_probeCubeData, const vmesh::LocalID Dacc, const vmesh::LocalID Dother, const size_t flatExtent, vmesh::LocalID *dev_numCols, vmesh::LocalID *dev_numColSets, vmesh::LocalID *dev_resizeSuccess, ColumnOffsets *dev_columnOffsetData, const uint cumulativeOffset, const size_t gpu_probeStride)
GPU kernel which performs exclusive prefix scans of the flattened probe cube, providing cumulative su...
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int const int max_v_length
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf * dev_intersections
split::SplitVector< vmesh::GlobalID > * list_with_replace_new
__host__ bool gpu_acc_map_1d(dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, vector< CellID > &launchCells, const uint popID, const uint dimension, const int Dacc, const int Dother, const size_t cumulativeOffset)
This function performs the semi-Lagrangian acceleration for a provided list of spatial cells,...
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int bailout_velocity_space_wall_margin
__global__ void flatten_probe_cube(vmesh::LocalID *dev_probeCubeData, const vmesh::LocalID Dacc, const vmesh::LocalID Dother, const size_t flatExtent, const vmesh::LocalID invalidLID, const size_t gpu_probeStride)
GPU kernel which flattens the probe cube into two reduction results (counters): how many columns and ...
const Realf intersection_dj
__shared__ int isSourceBlock[MAX_BLOCKS_PER_DIM]
ColumnOffsets * columnData
__global__ void vmesh::VelocityMesh **__restrict__ ColumnOffsets split::SplitVector< vmesh::GlobalID > Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > const uint *__restrict__ const Realf const int const int const Realf const Realf vmesh::LocalID * dev_resizeSuccess
#define ACCELERATION_KERNEl_MIN_BLOCKS
const uint parallelOffsetIndex
Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > * dev_map_require
__host__ void gpu_acc_allocate_perthread(uint allocID, uint firstAllocationCount, uint columnSetAllocationCount)
GPUMemoryManager gpuMemoryManager
__host__ void gpu_vlasov_allocate_perthread(uint allocID, uint blockAllocationCount)
__host__ gpuStream_t gpu_getStream()
size_t gpu_probeFlattenedSize
__host__ void gpu_calculateProbeAllocation(const uint maxBlockCount)
__host__ uint gpu_getAllocationCount()
#define SESSION_HOST_ALLOCATE(object, type, member, bytes)
static const int GPU_PROBEFLAT_N
#define SESSION_ALLOCATE(object, type, member, bytes)
#define GET_SESSION_POINTER(object, type, member)
#define GET_SESSION_HOST_POINTER(object, type, member)
#define GET_POINTER(object, type, member)
static const double BLOCK_ALLOCATION_FACTOR
__global__ void const Realf const uint *__restrict__ const uint *__restrict__ const vmesh::GlobalID *__restrict__ const uint const uint const uint const Realf const vmesh::VelocityMesh *__restrict__ const vmesh::VelocityBlockContainer Realf Realf ** dev_blockDataOrdered
ObjectWrapper & getObjectWrapper()
void extract_to_delete_or_move_caller(Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **input_maps, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **output_vecs, vmesh::LocalID *output_sizes, vmesh::VelocityMesh **rule_meshes, Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **rule_maps, split::SplitVector< vmesh::GlobalID > **rule_vectors, const uint nCells, gpuStream_t stream)
static __global__ void __launch_bounds__(WID3, 4) population_scale_kernel(vmesh
void batch_adjust_blocks_caller(dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &cellsToAdjust, const uint cellOffset, uint &out_largestBlocksToChange, uint &out_largestBlocksBeforeOrAfter, const uint popID)
void clear_maps_caller(const uint nCells, const size_t largestSizePower, gpuStream_t stream, const size_t offset)
void extract_to_replace_caller(Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **input_maps, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **output_vecs, vmesh::LocalID *output_sizes, vmesh::VelocityMesh **rule_meshes, Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **rule_maps, split::SplitVector< vmesh::GlobalID > **rule_vectors, const uint nCells, gpuStream_t stream)
std::vector< species::Species > particleSpecies
static uint bailout_velocity_space_wall_margin
static ARCH_HOSTDEV VecSimple< T > max(VecSimple< T > const &l, VecSimple< T > const &r)