|
template<typename N , typename F > |
void | build (N nitems, const_pointer_input_type v, const Box &bx, F &&f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (N nitems, const_pointer_input_type v, int nbins, F &&f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (BinPolicy::GPUBinPolicy, N nitems, const_pointer_input_type v, const Box &bx, F const &f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (BinPolicy::GPUBinPolicy, N nitems, const_pointer_input_type v, int nbins, F const &f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (BinPolicy::OpenMPBinPolicy, N nitems, const_pointer_input_type v, const Box &bx, F const &f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (BinPolicy::OpenMPBinPolicy, N nitems, const_pointer_input_type v, int nbins, F const &f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (BinPolicy::SerialBinPolicy, N nitems, const_pointer_input_type v, const Box &bx, F const &f) |
| Populate the bins with a set of items. More...
|
|
template<typename N , typename F > |
void | build (BinPolicy::SerialBinPolicy, N nitems, const_pointer_input_type v, int nbins, F const &f) |
| Populate the bins with a set of items. More...
|
|
Long | numItems () const noexcept |
| the number of items in the container More...
|
|
Long | numBins () const noexcept |
| the number of bins in the container More...
|
|
index_type * | permutationPtr () noexcept |
| returns the pointer to the permutation array More...
|
|
index_type * | offsetsPtr () noexcept |
| returns the pointer to the offsets array More...
|
|
index_type * | binsPtr () noexcept |
| returns the pointer to the bins array More...
|
|
const index_type * | permutationPtr () const noexcept |
| returns const pointer to the permutation array More...
|
|
const index_type * | offsetsPtr () const noexcept |
| returns const pointer to the offsets array More...
|
|
const index_type * | binsPtr () const noexcept |
| returns the const pointer to the bins array More...
|
|
DenseBinIteratorFactory< T > | getBinIteratorFactory () const noexcept |
| returns a GPU-capable object that can create iterators over the items in a bin. More...
|
|
template<typename T>
class amrex::DenseBins< T >
A container for storing items in a set of bins.
The underlying data structure is an array of size nitems defining a permutation of the items in the container that puts them in bin-sorted order, plus an array of size nbins+1 that stores the offsets into the permutation array where each bin starts.
The storage for the bins is "dense" in the sense that users pass in either a Box or an integer that defines the space over which the bins will be defined, and empty bins will still take up space.
- Template Parameters
-
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 3D box to specify the index space over which the bins are defined.
This overload uses the "GPU" parallelization strategy. If AMReX has been compiled for GPU, it runs on the GPU. Otherwise, it executes in serial.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
bx | the Box that defines the space over which the bins will be defined |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 1D index space for the set of bins.
This overload uses the "GPU" parallelization strategy. If AMReX has been compiled for GPU, it runs on the GPU. Otherwise, it executes in serial.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
nbins | the number of bins to use |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 3D box to specify the index space over which the bins are defined.
This overload uses the "OpenMP" parallelization strategy and always runs on the host. If AMReX has been compiled with OpenMP support, the execution will be parallelized, otherwise it will be serial.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
bx | the Box that defines the space over which the bins will be defined |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 1D index space for the set of bins.
This overload uses the "OpenMP" parallelization strategy and always runs on the host. If AMReX has been compiled with OpenMP support, the execution will be parallelized, otherwise it will be serial.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
nbins | the number of bins to use |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 3D box to specify the index space over which the bins are defined.
This overload uses the "Serial" parallelization strategy. It always runs in serial on the host, regardless of whether AMREX_USE_GPU or AMREX_USE_OMP has been defined.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
bx | the Box that defines the space over which the bins will be defined |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 1D index space for the set of bins.
This overload uses the "Serial" parallelization strategy. It always runs in serial on the host, regardless of whether AMREX_USE_GPU or AMREX_USE_OMP has been defined.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
nbins | the number of bins to use |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 3D box to specify the index space over which the bins are defined.
This overload uses the "default" parallelization strategy. If AMReX has been compiled for GPU, it runs on the GPU. Otherwise, it executes in serial.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
bx | the Box that defines the space over which the bins will be defined |
f | a function object that maps items to bins |
template<typename T >
template<typename N , typename F >
Populate the bins with a set of items.
The algorithm is similar to a counting sort. First, we count the number of items in each bin. Then, we perform a prefix sum on the resulting counts. Finally, the set of partial sums is incremented in parallel using atomicInc, which results in a permutation array that places the items in bin-sorted order.
This version uses a 1D index space for the set of bins.
This overload uses the "default" parallelization strategy. If AMReX has been compiled for GPU, it runs on the GPU. Otherwise, it executes in serial.
- Template Parameters
-
N | the 'size' type that can enumerate all the items |
F | a function that maps items to IntVect bins |
- Parameters
-
nitems | the number of items to put in the bins |
v | ParticleTileData or pointer to the start of the items |
nbins | the number of bins to use |
f | a function object that maps items to bins |