template<unsigned int dim, typename T, typename S, typename linearizer>
class grid_base< dim, T, S, typename memory_traits_inte< T >::type, linearizer >
This is an N-dimensional grid or an N-dimensional array with memory_traits_inte layout.
it is basically an N-dimensional Cartesian grid
- Template Parameters
-
dim | Dimensionality of the grid |
T | type of object the grid store |
Mem | memory layout |
Definition and allocation of a 3D grid on GPU memory
Access a grid c3 of size sz on each direction
for (size_t i = 0 ; i < sz ; i++)
{
for (size_t j = 0 ; j < sz ; j++)
{
for (size_t k = 0 ; k < sz ; k++)
{
c3.template get<P::x>(kk) = 1.1f;
c3.template get<P::y>(kk) = 1.2f;
c3.template get<P::z>(kk) = 1.3f;
c3.template get<P::s>(kk) = 1.0f;
c3.template get<P::v>(kk)[0] = 1.0f;
c3.template get<P::v>(kk)[1] = 2.0f;
c3.template get<P::v>(kk)[2] = 3.0f;
c3.template get<P::t>(kk)[0][0] = 1.0f;
c3.template get<P::t>(kk)[0][1] = 2.0f;
c3.template get<P::t>(kk)[0][2] = 3.0f;
c3.template get<P::t>(kk)[1][0] = 4.0f;
c3.template get<P::t>(kk)[1][1] = 5.0f;
c3.template get<P::t>(kk)[1][2] = 6.0f;
c3.template get<P::t>(kk)[2][0] = 7.0f;
c3.template get<P::t>(kk)[2][1] = 8.0f;
c3.template get<P::t>(kk)[2][2] = 9.0f;
}
}
}
Access to an N-dimensional grid with an iterator
Definition at line 502 of file map_grid.hpp.
|
| grid_base () THROW |
| Default constructor.
|
|
| grid_base (const grid_base &g) THROW |
| create a grid from another grid More...
|
|
| grid_base (grid_base &&g) THROW |
| create a grid from another grid More...
|
|
| grid_base (const size_t &sz) THROW |
| create a grid of size sz on each direction More...
|
|
| grid_base (const size_t(&sz)[dim]) THROW |
| Constructor allocate memory and give them a representation.
|
|
template<unsigned int id> |
void | fill (unsigned char c) |
| Fill the memory with a byte. More...
|
|
template<unsigned int id> |
void * | getDeviceBuffer () |
| It return the properties arrays. More...
|
|
void | convert_key (grid_key_dx< dim > &key_out, const grid_key_dx< dim > &key_in) const |
| In this case it just copy the key_in in key_out. More...
|
|
T & | getBackgroundValue () |
| Get the background value. More...
|
|
T & | getBackgroundValueAggr () |
| Get the background value. More...
|
|
grid_base< dim, T, S, typename memory_traits_inte< T >::type, linearizer > & | operator= (const grid_base_impl< dim, T, S, memory_traits_inte, linearizer > &base) |
| assign operator More...
|
|
grid_base< dim, T, S, typename memory_traits_inte< T >::type, linearizer > & | operator= (grid_base_impl< dim, T, S, memory_traits_inte, linearizer > &&base) |
| assign operator More...
|
|
void | pack (ExtPreAlloc< S > &mem, Pack_stat &sts) const |
| pack a grid selecting the properties to pack More...
|
|
void | pack (ExtPreAlloc< S > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Pack_stat &sts) |
| Pack the object into the memory given an iterator. More...
|
|
void | packReset () |
| Reset the pack calculation. More...
|
|
void | packCalculate (size_t &req, const context_type &ctx) |
| Pack calculate. More...
|
|
void | packRequest (size_t &req) const |
| Insert an allocation request into the vector. More...
|
|
void | packRequest (grid_key_dx_iterator_sub< dims > &sub, size_t &req) |
| Insert an allocation request. More...
|
|
void | unpack (ExtPreAlloc< S > &mem, Unpack_stat &ps) |
| unpack a grid More...
|
|
void | unpack (ExtPreAlloc< S2 > &mem, grid_key_dx_iterator_sub< dims > &sub_it, Unpack_stat &ps, context_type &context, rem_copy_opt opt) |
| unpack the sub-grid object More...
|
|
void | packFinalize (ExtPreAlloc< S > &mem, Pack_stat &sts, int opt, bool is_pack_remote) |
| Pack finalize Finalize the pack of this object. In this case it does nothing. More...
|
|
void | unpack_with_op (ExtPreAlloc< S2 > &mem, grid_key_dx_iterator_sub< dim > &sub2, Unpack_stat &ps) |
| unpack the sub-grid object applying an operation More...
|
|
| grid_base_impl () THROW |
| Default constructor.
|
|
| grid_base_impl (const grid_base_impl &g) THROW |
| create a grid from another grid More...
|
|
| grid_base_impl (const size_t &sz) THROW |
| create a grid of size sz on each direction More...
|
|
| grid_base_impl (const size_t(&sz)[dim]) THROW |
| Constructor. More...
|
|
| ~grid_base_impl () THROW |
| Destructor.
|
|
grid_base_impl< dim, T, S, memory_traits_inte > & | operator= (const grid_base_impl< dim, T, S, memory_traits_inte > &g) |
| It copy a grid. More...
|
|
grid_base_impl< dim, T, S, memory_traits_inte > & | operator= (grid_base_impl< dim, T, S, memory_traits_inte > &&g) |
| It copy a grid. More...
|
|
bool | operator== (const grid_base_impl< dim, T, S, memory_traits_inte > &g) |
| Compare two grids. More...
|
|
grid_base_impl< dim, T, S, memory_traits_inte > | duplicate () const THROW |
| create a duplicated version of the grid More...
|
|
int | size (int i) const |
| Get the size if the grid in the direction i. More...
|
|
size_t | size () const |
| return the size of the grid More...
|
|
const linearizer & | getGrid () const |
| Return the internal grid information. More...
|
|
void | setMemory () |
| Create the object that provide memory. More...
|
|
void | setMemory (S &m) |
| Set the object that provide memory from outside. More...
|
|
auto | getMemory () -> decltype(boost::fusion::at_c< p >(data_).getMemory()) |
| Return the memory object. More...
|
|
void | setMemoryArray (S *m) |
| Set the object that provide memory from outside. More...
|
|
void * | getPointer () |
| Return a plain pointer to the internal data. More...
|
|
const void * | getPointer () const |
| Return a plain pointer to the internal data. More...
|
|
r_type | insert (const grid_key_dx< dim > &v1) |
| In this case insert is equivalent to get. More...
|
|
__device__ __host__ r_type | get_usafe (const grid_key_dx< dim > &v1) |
| Get the reference of the selected element. More...
|
|
int | getBlockEdgeSize () |
| No blocks here, it return 1. More...
|
|
void | setGPUInsertBuffer (unsigned int nb, unsigned int nt) |
| No blocks here, it does nothing. More...
|
|
__device__ __host__ r_type | get_unsafe (const grid_key_dx< dim > &v1) const |
| Get the const reference of the selected element. More...
|
|
__device__ __host__ r_type | get (const grid_key_dx< dim > &v1) |
| Get the reference of the selected element. More...
|
|
__device__ __host__ r_type | get (const grid_key_dx< dim > &v1) const |
| Get the const reference of the selected element. More...
|
|
__device__ __host__ r_type | get (const size_t lin_id) |
| Get the reference of the selected element. More...
|
|
__device__ __host__ const r_type | get (size_t lin_id) const |
| Get the const reference of the selected element. More...
|
|
__device__ __host__ unsigned char | getFlag (const grid_key_dx< dim > &v1) const |
| Get the point flag (in this case just return 0) More...
|
|
encapc< dim, T, layout > | get_o (const grid_key_dx< dim > &v1) |
| Get the of the selected element as a boost::fusion::vector. More...
|
|
const encapc< dim, T, layout > | get_o (const grid_key_dx< dim > &v1) const |
| Get the of the selected element as a boost::fusion::vector. More...
|
|
encapc< dim, T, layout > | get_o (size_t v1) |
| Get the of the selected element as a boost::fusion::vector. More...
|
|
const encapc< dim, T, layout > | get_o (size_t v1) const |
| Get the of the selected element as a boost::fusion::vector. More...
|
|
encapc< dim, T, layout > | insert_o (const grid_key_dx< dim > &v1) |
| Get the of the selected element as a boost::fusion::vector. More...
|
|
void | fill (unsigned char fl) |
| Fill the memory with the selected byte. More...
|
|
void | remove (Box< dim, long int > §ion_to_delete) |
| Remove all the points in this region. More...
|
|
void | remove (size_t key) |
| Remove one element valid only on 1D. More...
|
|
void | copyRemoveReset () |
| Reset the queue to remove and copy section of grids. More...
|
|
bool | isSkipLabellingPossible () |
| This function check if keep geometry is possible for this grid. More...
|
|
void | copy_to (const grid_base_impl< dim, T, S, memory_traits_inte > &grid_src, const Box< dim, long int > &box_src, const Box< dim, long int > &box_dst) |
| copy an external grid into a specific place into this grid More...
|
|
void | copy_to_prp (const grid_base_impl< dim, T, S, memory_traits_inte > &grid_src, const Box< dim, size_t > &box_src, const Box< dim, size_t > &box_dst) |
| copy an external grid into a specific place into this grid More...
|
|
void | clear () |
| It does nothing. More...
|
|
void | copy_to_op (const grid_base_impl< dim, T, S, memory_traits_inte > &gs, const Box< dim, size_t > &bx_src, const Box< dim, size_t > &bx_dst) |
| copy an external grid into a specific place into this grid More...
|
|
void | resize (const size_t(&sz)[dim], size_t opt=DATA_ON_HOST|DATA_ON_DEVICE, unsigned int blockSize=1) |
| Resize the grid. More...
|
|
void | resize_no_device (const size_t(&sz)[dim]) |
| Resize the space. More...
|
|
void | swap_nomode (grid_base_impl< dim, T, S, memory_traits_inte > &grid) |
| It swap the objects A become B and B become A using A.swap(B);. More...
|
|
void | swap (grid_base_impl< dim, T, S, memory_traits_inte, linearizer > &grid) |
| It swap the objects A become B and B become A using A.swap(B);. More...
|
|
void | swap (grid_base_impl< dim, T, S, memory_traits_inte > &&grid) |
| It move the allocated object from one grid to another. More...
|
|
__device__ __host__ void | set (const grid_key_dx< dim > &key1, const grid_base_impl &g, const grid_key_dx< dim > &key2) |
| set only some properties More...
|
|
void | set (grid_key_dx< dim > dx, const encapc< 1, T, Memory > &obj) |
| set an element of the grid More...
|
|
void | set (grid_key_dx< dim > dx, const T &obj) |
| set an element of the grid More...
|
|
void | set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, S, memory_traits_inte > &g, const grid_key_dx< dim > &key2) |
| Set an element of the grid from another element of another grid. More...
|
|
void | set (const size_t key1, const grid_base_impl< dim, T, S, memory_traits_inte > &g, const size_t key2) |
| Set an element of the grid from another element of another grid. More...
|
|
void | set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, Mem, memory_traits_inte > &g, const grid_key_dx< dim > &key2) |
| Set an element of the grid from another element of another grid. More...
|
|
void | set_general (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, Mem, layout_base2 > &g, const grid_key_dx< dim > &key2) |
| Set an element of the grid from another element of another grid. More...
|
|
grid_key_dx_iterator_sub< dim > | getSubIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop) const |
| Return a sub-grid iterator. More...
|
|
grid_key_dx_iterator_sub< dim > | getSubIterator (size_t m) |
| Return a sub-grid iterator. More...
|
|
grid_key_dx_iterator< dim > | getIterator () const |
| Return a grid iterator. More...
|
|
grid_key_dx_iterator_sub< dim > | getIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop, bool to_init=false) const |
| Return a grid iterator over all points included between start and stop point. More...
|
|
void | deviceToHost () |
| Synchronize the memory buffer in the device with the memory in the host. More...
|
|
void | deviceToHost (size_t start, size_t stop) |
| Synchronize the memory buffer in the device with the memory in the host. More...
|
|
void | hostToDeviceNUMA (size_t start, size_t stop) |
| Synchronize the memory buffer in the device with the memory in the host (respecting the NUMA domains) More...
|
|
void | hostToDeviceNUMA () |
| Synchronize the memory buffer in the device with the memory in the host (respecting the NUMA domains) More...
|
|
void | hostToDevice (size_t start, size_t stop) |
| Synchronize the memory buffer in the device with the memory in the host. More...
|
|
void | hostToDevice () |
| Copy the memory from host to device. More...
|
|
grid_gpu_ker< dim, T_, memory_traits_inte, linearizer_type > | toKernel () |
| Convert the grid into a data-structure compatible for computing into GPU. More...
|
|
const grid_gpu_ker< dim, T_, memory_traits_inte, linearizer_type > | toKernel () const |
| Convert the grid into a data-structure compatible for computing into GPU. More...
|
|
grid_key_dx_iterator< dim, stencil_offset_compute< dim, Np > > | getIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) const |
| Return a grid iterator. More...
|
|
layout & | get_internal_data_ () |
| return the internal data_ More...
|
|
const layout & | get_internal_data_ () const |
| return the internal data_ More...
|
|
void | removeAddUnpackReset () |
| In this case it does nothing. More...
|
|
void | removeAddUnpackFinalize (const context_type &ctx, int opt) |
| In this case it does nothing. More...
|
|
void | removeCopyToFinalize (const context_type &ctx, int opt) |
| In this case it does nothing. More...
|
|
void | resetFlush () |
| It does nothing. More...
|
|