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;
}
}
}
Test structure used for several test.
grid_key_dx is the key to access any element in the grid
__device__ __host__ void set(a v, T...t)
set the Key from a list of numbers
Class for cpu time benchmarking.
void start()
Start the timer.
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
|
|
| grid_base (grid_base &&g) THROW |
| create a grid from another grid
|
|
| grid_base (const size_t &sz) THROW |
| create a grid of size sz on each direction
|
|
| 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.
|
|
template<unsigned int id> |
void * | getDeviceBuffer () |
| It return the properties arrays.
|
|
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.
|
|
T & | getBackgroundValue () |
| Get the background value.
|
|
T & | getBackgroundValueAggr () |
| Get the background value.
|
|
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
|
|
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
|
|
| grid_base_impl () THROW |
| Default constructor.
|
|
| grid_base_impl (const grid_base_impl &g) THROW |
| create a grid from another grid
|
|
| grid_base_impl (const size_t &sz) THROW |
| create a grid of size sz on each direction
|
|
| grid_base_impl (const size_t(&sz)[dim]) THROW |
| Constructor.
|
|
| ~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.
|
|
grid_base_impl< dim, T, S, memory_traits_inte > & | operator= (grid_base_impl< dim, T, S, memory_traits_inte > &&g) |
| It copy a grid.
|
|
bool | operator== (const grid_base_impl< dim, T, S, memory_traits_inte > &g) |
| Compare two grids.
|
|
grid_base_impl< dim, T, S, memory_traits_inte > | duplicate () const THROW |
| create a duplicated version of the grid
|
|
int | size (int i) const |
| Get the size if the grid in the direction i.
|
|
size_t | size () const |
| return the size of the grid
|
|
const linearizer & | getGrid () const |
| Return the internal grid information.
|
|
void | setMemory () |
| Create the object that provide memory.
|
|
void | setMemory (S &m) |
| Set the object that provide memory from outside.
|
|
auto | getMemory () -> decltype(boost::fusion::at_c< p >(data_).getMemory()) |
| Return the memory object.
|
|
void | setMemoryArray (S *m) |
| Set the object that provide memory from outside.
|
|
void * | getPointer () |
| Return a plain pointer to the internal data.
|
|
const void * | getPointer () const |
| Return a plain pointer to the internal data.
|
|
r_type | insert (const grid_key_dx< dim > &v1) |
| In this case insert is equivalent to get.
|
|
__device__ __host__ r_type | get_usafe (const grid_key_dx< dim > &v1) |
| Get the reference of the selected element.
|
|
int | getBlockEdgeSize () |
| No blocks here, it return 1.
|
|
void | setGPUInsertBuffer (unsigned int nb, unsigned int nt) |
| No blocks here, it does nothing.
|
|
__device__ __host__ r_type | get_unsafe (const grid_key_dx< dim > &v1) const |
| Get the const reference of the selected element.
|
|
__device__ __host__ r_type | get (const grid_key_dx< dim > &v1) |
| Get the reference of the selected element.
|
|
__device__ __host__ r_type | get (const grid_key_dx< dim > &v1) const |
| Get the const reference of the selected element.
|
|
__device__ __host__ r_type | get (const size_t lin_id) |
| Get the reference of the selected element.
|
|
__device__ __host__ const r_type | get (size_t lin_id) const |
| Get the const reference of the selected element.
|
|
__device__ __host__ unsigned char | getFlag (const grid_key_dx< dim > &v1) const |
| Get the point flag (in this case just return 0)
|
|
encapc< dim, T, layout > | get_o (const grid_key_dx< dim > &v1) |
| Get the of the selected element as a boost::fusion::vector.
|
|
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.
|
|
encapc< dim, T, layout > | get_o (size_t v1) |
| Get the of the selected element as a boost::fusion::vector.
|
|
const encapc< dim, T, layout > | get_o (size_t v1) const |
| Get the of the selected element as a boost::fusion::vector.
|
|
encapc< dim, T, layout > | insert_o (const grid_key_dx< dim > &v1) |
| Get the of the selected element as a boost::fusion::vector.
|
|
void | fill (unsigned char fl) |
| Fill the memory with the selected byte.
|
|
void | remove (Box< dim, long int > §ion_to_delete) |
| Remove all the points in this region.
|
|
void | remove (size_t key) |
| Remove one element valid only on 1D.
|
|
void | copyRemoveReset () |
| Reset the queue to remove and copy section of grids.
|
|
bool | isSkipLabellingPossible () |
| This function check if keep geometry is possible for this grid.
|
|
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
|
|
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
|
|
void | clear () |
| It does nothing.
|
|
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
|
|
void | resize (const size_t(&sz)[dim], size_t opt=DATA_ON_HOST|DATA_ON_DEVICE, unsigned int blockSize=1) |
| Resize the grid.
|
|
void | resize_no_device (const size_t(&sz)[dim]) |
| Resize the space.
|
|
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);.
|
|
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);.
|
|
void | swap (grid_base_impl< dim, T, S, memory_traits_inte > &&grid) |
| It move the allocated object from one grid to another.
|
|
__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
|
|
void | set (grid_key_dx< dim > dx, const encapc< 1, T, Memory > &obj) |
| set an element of the grid
|
|
void | set (grid_key_dx< dim > dx, const T &obj) |
| set an element of the grid
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
grid_key_dx_iterator_sub< dim > | getSubIterator (size_t m) |
| Return a sub-grid iterator.
|
|
grid_key_dx_iterator< dim > | getIterator () const |
| Return a grid iterator.
|
|
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.
|
|
void | deviceToHost () |
| Synchronize the memory buffer in the device with the memory in the host.
|
|
void | deviceToHost (size_t start, size_t stop) |
| Synchronize the memory buffer in the device with the memory in the host.
|
|
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)
|
|
void | hostToDeviceNUMA () |
| Synchronize the memory buffer in the device with the memory in the host (respecting the NUMA domains)
|
|
void | hostToDevice (size_t start, size_t stop) |
| Synchronize the memory buffer in the device with the memory in the host.
|
|
void | hostToDevice () |
| Copy the memory from host to device.
|
|
grid_gpu_ker< dim, T_, memory_traits_inte, linearizer_type > | toKernel () |
| Convert the grid into a data-structure compatible for computing into GPU.
|
|
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.
|
|
grid_key_dx_iterator< dim, stencil_offset_compute< dim, Np > > | getIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) const |
| Return a grid iterator.
|
|
layout & | get_internal_data_ () |
| return the internal data_
|
|
const layout & | get_internal_data_ () const |
| return the internal data_
|
|
void | removeAddUnpackReset () |
| In this case it does nothing.
|
|
void | removeAddUnpackFinalize (const context_type &ctx, int opt) |
| In this case it does nothing.
|
|
void | removeCopyToFinalize (const context_type &ctx, int opt) |
| In this case it does nothing.
|
|
void | resetFlush () |
| It does nothing.
|
|