OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain > Class Template Reference

Given the decomposition it create an iterator. More...

Detailed Description

template<typename Decomposition, typename deviceGrids, bool ghost_or_domain = false>
class grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >

Given the decomposition it create an iterator.

Iterator across the local elements of the distributed grid

Template Parameters
decDecomposition type

Definition at line 60 of file grid_dist_id_iterator_gpu.cuh.

Public Member Functions

 grid_dist_id_iterator_gpu (deviceGrids &loc_grids, Decomposition &dec, const size_t(&sz)[Decomposition::dims])
 Copy operator=.
 
 grid_dist_id_iterator_gpu (deviceGrids &loc_grids, Decomposition &dec, const size_t(&sz)[Decomposition::dims], grid_key_dx< Decomposition::dims > start, grid_key_dx< Decomposition::dims > stop)
 Constructor of the distributed grid iterator.
 
void setGPUInsertBuffer (int nSlot)
 The the number of maximum inserts each GPU block can do.
 
void setBlockThreads (size_t nthr)
 Set the number of threads for each block.
 
bool isNextGrid ()
 Return true if we point to a valid grid.
 
size_t getGridId ()
 Return the index of the grid in which we are iterating.
 
void nextGrid ()
 next grid
 
Decomposition::stype getSpacing (size_t i)
 Get the spacing of the grid.
 
template<unsigned int impl = 0, typename func_t , typename ... argsType>
void launch (func_t functor, argsType ... args)
 Launch a functor with a particular kernel.
 
grid_key_dx< Decomposition::dims > getStart ()
 Get the starting point of the sub-grid we are iterating.
 
grid_key_dx< Decomposition::dims > getStop ()
 Get the starting point of the sub-grid we are iterating.
 

Private Attributes

size_t g_c
 grid list counter
 
openfpm::vector< GBoxes< Decomposition::dims > > gdb_ext
 Extension of each grid: domain and ghost + domain.
 
grid_key_dx< Decomposition::dims > start
 start key
 
grid_key_dx< Decomposition::dims > stop
 stop key
 
deviceGrids & loc_grids
 Local device grids.
 
size_t n_thr
 number of threads to launch the kernels
 
int nSlot = -1
 Maximum number of insertions for each GPU block.
 
Decomposition::stype spacing [Decomposition::dims]
 Spacing.
 

Constructor & Destructor Documentation

◆ grid_dist_id_iterator_gpu() [1/2]

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::grid_dist_id_iterator_gpu ( deviceGrids &  loc_grids,
Decomposition dec,
const size_t(&)  sz[Decomposition::dims] 
)
inline

Copy operator=.

Parameters
tmpiterator to copy
Returns
itself

Copy constructor

Parameters
tmpiterator to copy

Constructor of the distributed grid iterator

Parameters
decDecomposition
szsize of the grid

Definition at line 124 of file grid_dist_id_iterator_gpu.cuh.

◆ grid_dist_id_iterator_gpu() [2/2]

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::grid_dist_id_iterator_gpu ( deviceGrids &  loc_grids,
Decomposition dec,
const size_t(&)  sz[Decomposition::dims],
grid_key_dx< Decomposition::dims >  start,
grid_key_dx< Decomposition::dims >  stop 
)
inline

Constructor of the distributed grid iterator.

Parameters
decDecomposition
szsize of the grid
startpoint
stoppoint

Definition at line 146 of file grid_dist_id_iterator_gpu.cuh.

◆ ~grid_dist_id_iterator_gpu()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::~grid_dist_id_iterator_gpu ( )
inline

Definition at line 156 of file grid_dist_id_iterator_gpu.cuh.

Member Function Documentation

◆ getGridId()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
size_t grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::getGridId ( )
inline

Return the index of the grid in which we are iterating.

Definition at line 194 of file grid_dist_id_iterator_gpu.cuh.

◆ getSpacing()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
Decomposition::stype grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::getSpacing ( size_t  i)
inline

Get the spacing of the grid.

Parameters
i

Definition at line 214 of file grid_dist_id_iterator_gpu.cuh.

◆ getStart()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_key_dx< Decomposition::dims > grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::getStart ( )
inline

Get the starting point of the sub-grid we are iterating.

Returns
the starting point

Definition at line 293 of file grid_dist_id_iterator_gpu.cuh.

◆ getStop()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_key_dx< Decomposition::dims > grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::getStop ( )
inline

Get the starting point of the sub-grid we are iterating.

Returns
the stop point

Definition at line 303 of file grid_dist_id_iterator_gpu.cuh.

◆ isNextGrid()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
bool grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::isNextGrid ( )
inline

Return true if we point to a valid grid.

Returns
true if valid grid

Definition at line 185 of file grid_dist_id_iterator_gpu.cuh.

◆ launch()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
template<unsigned int impl = 0, typename func_t , typename ... argsType>
void grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::launch ( func_t  functor,
argsType ...  args 
)
inline

Launch a functor with a particular kernel.

Parameters
functorfunction kernel
argsTypearguments

Definition at line 226 of file grid_dist_id_iterator_gpu.cuh.

◆ nextGrid()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
void grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::nextGrid ( )
inline

next grid

Definition at line 203 of file grid_dist_id_iterator_gpu.cuh.

◆ setBlockThreads()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
void grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::setBlockThreads ( size_t  nthr)
inline

Set the number of threads for each block.

Parameters
nthrnumber of threads for each block

Definition at line 175 of file grid_dist_id_iterator_gpu.cuh.

◆ setGPUInsertBuffer()

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
void grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::setGPUInsertBuffer ( int  nSlot)
inline

The the number of maximum inserts each GPU block can do.

Parameters
nSlotmaximum number of insert

Definition at line 165 of file grid_dist_id_iterator_gpu.cuh.

Field Documentation

◆ g_c

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
size_t grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::g_c
private

grid list counter

Definition at line 63 of file grid_dist_id_iterator_gpu.cuh.

◆ gdb_ext

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
openfpm::vector<GBoxes<Decomposition::dims> > grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::gdb_ext
private

Extension of each grid: domain and ghost + domain.

Definition at line 66 of file grid_dist_id_iterator_gpu.cuh.

◆ loc_grids

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
deviceGrids& grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::loc_grids
private

Local device grids.

Definition at line 75 of file grid_dist_id_iterator_gpu.cuh.

◆ n_thr

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
size_t grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::n_thr
private

number of threads to launch the kernels

Definition at line 78 of file grid_dist_id_iterator_gpu.cuh.

◆ nSlot

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
int grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::nSlot = -1
private

Maximum number of insertions for each GPU block.

Definition at line 81 of file grid_dist_id_iterator_gpu.cuh.

◆ spacing

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
Decomposition::stype grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::spacing[Decomposition::dims]
private

Spacing.

Definition at line 84 of file grid_dist_id_iterator_gpu.cuh.

◆ start

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::start
private

start key

Definition at line 69 of file grid_dist_id_iterator_gpu.cuh.

◆ stop

template<typename Decomposition , typename deviceGrids , bool ghost_or_domain = false>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_gpu< Decomposition, deviceGrids, ghost_or_domain >::stop
private

stop key

Definition at line 72 of file grid_dist_id_iterator_gpu.cuh.


The documentation for this class was generated from the following file: