Implementation of a N-dimensional grid. More...
Implementation of a N-dimensional grid.
dim | dimansionality of the grid |
T | type store by the grid |
S | Memory pool from where to take the memory |
layout_base | layout memory meta-function (the meta-function used to construct layout_) |
Definition at line 379 of file grid_base_implementation.hpp.
#include <grid_base_implementation.hpp>
Public Types | |
typedef layout | layout_type |
memory layout | |
typedef grid_key_dx< dim > | access_key |
Access key. | |
typedef T::type | T_type |
boost::vector that describe the data type | |
typedef layout_base< T > | layout_base_ |
base layout type | |
typedef ord_type | linearizer_type |
typedef T | background_type |
typedef int | yes_i_am_grid |
it define that this data-structure is a grid | |
typedef memory_traits_lin< typenameT::type >::type | memory_lin |
Definition of the layout. | |
typedef encapc< dim, T, layout > | container |
Object container for T, it is the return type of get_o it return a object type trough. | |
typedef T | value_type |
The object type the grid is storing. | |
Public Member Functions | |
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, layout_base > & | operator= (const grid_base_impl< dim, T, S, layout_base > &g) |
It copy a grid. | |
grid_base_impl< dim, T, S, layout_base > & | operator= (grid_base_impl< dim, T, S, layout_base > &&g) |
It copy a grid. | |
bool | operator== (const grid_base_impl< dim, T, S, layout_base > &g) |
Compare two grids. | |
grid_base_impl< dim, T, S, layout_base > | 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. | |
const ord_type & | getGrid () const |
Return the internal grid information. | |
void | setMemory () |
Create the object that provide memory. | |
template<unsigned int p> | |
auto | getMemory () -> decltype(boost::fusion::at_c< p >(data_).getMemory()) |
Return the memory object. | |
template<unsigned int p = 0> | |
void | setMemory (S &m) |
Set the object that provide memory from outside. | |
void | setMemoryArray (S *m) |
Set the object that provide memory from outside. | |
template<unsigned int p = 0> | |
void * | getPointer () |
Return a plain pointer to the internal data. | |
template<unsigned int p = 0> | |
const void * | getPointer () const |
Return a plain pointer to the internal data. | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get<p>(data_,g1,grid_key_dx<dim>()))> | |
r_type | insert (const grid_key_dx< dim > &v1) |
In this case insert is equivalent to get. | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get<p>(data_,g1,grid_key_dx<dim>()))> | |
__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. | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get_c<p>(data_,g1,grid_key_dx<dim>()))> | |
__device__ __host__ r_type | get_unsafe (const grid_key_dx< dim > &v1) const |
Get the const reference of the selected element. | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get<p>(data_,g1,grid_key_dx<dim>()))> | |
__device__ __host__ r_type | get (const grid_key_dx< dim > &v1) |
Get the 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) | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get_c<p>(data_,g1,grid_key_dx<dim>()))> | |
__device__ __host__ r_type | get (const grid_key_dx< dim > &v1) const |
Get the const reference of the selected element. | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get_lin<p>(data_,g1,0))> | |
__device__ __host__ r_type | get (const size_t lin_id) |
Get the reference of the selected element. | |
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get_lin<p>(data_,g1,0))> | |
__device__ __host__ const r_type | get (size_t lin_id) const |
Get the const reference of the selected element. | |
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 > | insert_o (const grid_key_dx< dim > &v1) |
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. | |
template<int prp> | |
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 | 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, layout_base > &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 | |
template<unsigned int ... prp> | |
void | copy_to_prp (const grid_base_impl< dim, T, S, layout_base > &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. | |
template<template< typename, typename > class op, unsigned int ... prp> | |
void | copy_to_op (const grid_base_impl< dim, T, S, layout_base > &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 | remove (size_t key) |
Remove one element valid only on 1D. | |
void | swap_nomode (grid_base_impl< dim, T, S, layout_base > &grid) |
It swap the objects A become B and B become A using A.swap(B);. | |
void | swap (grid_base_impl< dim, T, S, layout_base, ord_type > &grid) |
It swap the objects A become B and B become A using A.swap(B);. | |
void | swap (grid_base_impl< dim, T, S, layout_base > &&grid) |
It move the allocated object from one grid to another. | |
template<unsigned int ... prp> | |
__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 | |
template<typename Memory > | |
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, layout_base > &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, layout_base > &g, const size_t key2) |
Set an element of the grid from another element of another grid. | |
template<typename Mem > | |
void | set (const grid_key_dx< dim > &key1, const grid_base_impl< dim, T, Mem, layout_base > &g, const grid_key_dx< dim > &key2) |
Set an element of the grid from another element of another grid. | |
template<typename Mem , template< typename > class layout_base2> | |
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. | |
size_t | size () const |
return the size of the 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. | |
template<unsigned int ... prp> | |
void | deviceToHost () |
Synchronize the memory buffer in the device with the memory in the host. | |
template<unsigned int ... prp> | |
void | deviceToHost (size_t start, size_t stop) |
Synchronize the memory buffer in the device with the memory in the host. | |
template<unsigned int ... prp> | |
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) | |
template<unsigned int ... prp> | |
void | hostToDeviceNUMA () |
Synchronize the memory buffer in the device with the memory in the host (respecting the NUMA domains) | |
template<unsigned int ... prp> | |
void | hostToDevice (size_t start, size_t stop) |
Synchronize the memory buffer in the device with the memory in the host. | |
template<unsigned int ... prp> | |
void | hostToDevice () |
Copy the memory from host to device. | |
grid_gpu_ker< dim, T_, layout_base, linearizer_type > | toKernel () |
Convert the grid into a data-structure compatible for computing into GPU. | |
const grid_gpu_ker< dim, T_, layout_base, linearizer_type > | toKernel () const |
Convert the grid into a data-structure compatible for computing into GPU. | |
template<unsigned int Np> | |
grid_key_dx_iterator< dim, stencil_offset_compute< dim, Np > > | getIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) 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. | |
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. | |
template<unsigned int ... prp, typename context_type > | |
void | removeAddUnpackFinalize (const context_type &ctx, int opt) |
In this case it does nothing. | |
template<unsigned int ... prp, typename context_type > | |
void | removeCopyToFinalize (const context_type &ctx, int opt) |
In this case it does nothing. | |
void | resetFlush () |
It does nothing. | |
Static Public Member Functions | |
static bool | is_unpack_header_supported () |
Indicate that unpacking the header is supported. | |
Static Public Attributes | |
static constexpr unsigned int | dims = dim |
expose the dimansionality as a static const | |
Protected Attributes | |
layout | data_ |
Memory layout specification + memory chunk pointer. | |
ord_type | g1 |
This is a structure that store all information related to the grid and how indexes are linearized. | |
Private Types | |
typedef layout_base< T >::type | layout |
memory layout | |
typedef apply_transform< layout_base, T >::type | T_ |
Private Member Functions | |
void | resize_impl_device (const size_t(&sz)[dim], grid_base_impl< dim, T, S, layout_base, ord_type > &grid_new, unsigned int blockSize=1) |
void | resize_impl_host (const size_t(&sz)[dim], grid_base_impl< dim, T, S, layout_base, ord_type > &grid_new) |
void | resize_impl_memset (grid_base_impl< dim, T, S, layout_base, ord_type > &grid_new) |
Private Attributes | |
bool | is_mem_init = false |
Is the memory initialized. | |
bool | isExternal |
The memory allocator is not internally created. | |
typedef grid_key_dx<dim> grid_base_impl< dim, T, S, layout_base, ord_type >::access_key |
Access key.
Definition at line 395 of file grid_base_implementation.hpp.
typedef T grid_base_impl< dim, T, S, layout_base, ord_type >::background_type |
Definition at line 405 of file grid_base_implementation.hpp.
typedef encapc<dim,T,layout> grid_base_impl< dim, T, S, layout_base, ord_type >::container |
Object container for T, it is the return type of get_o it return a object type trough.
Definition at line 641 of file grid_base_implementation.hpp.
|
private |
memory layout
Definition at line 382 of file grid_base_implementation.hpp.
typedef layout_base<T> grid_base_impl< dim, T, S, layout_base, ord_type >::layout_base_ |
base layout type
Definition at line 401 of file grid_base_implementation.hpp.
typedef layout grid_base_impl< dim, T, S, layout_base, ord_type >::layout_type |
memory layout
Definition at line 389 of file grid_base_implementation.hpp.
typedef ord_type grid_base_impl< dim, T, S, layout_base, ord_type >::linearizer_type |
Definition at line 403 of file grid_base_implementation.hpp.
typedef memory_traits_lin<typenameT::type>::type grid_base_impl< dim, T, S, layout_base, ord_type >::memory_lin |
Definition of the layout.
Definition at line 637 of file grid_base_implementation.hpp.
|
private |
Definition at line 384 of file grid_base_implementation.hpp.
typedef T::type grid_base_impl< dim, T, S, layout_base, ord_type >::T_type |
boost::vector that describe the data type
Definition at line 398 of file grid_base_implementation.hpp.
typedef T grid_base_impl< dim, T, S, layout_base, ord_type >::value_type |
The object type the grid is storing.
Definition at line 644 of file grid_base_implementation.hpp.
typedef int grid_base_impl< dim, T, S, layout_base, ord_type >::yes_i_am_grid |
it define that this data-structure is a grid
Definition at line 634 of file grid_base_implementation.hpp.
|
inline |
Default constructor.
Definition at line 647 of file grid_base_implementation.hpp.
|
inline |
create a grid from another grid
g | the grid to copy |
Definition at line 659 of file grid_base_implementation.hpp.
|
inline |
create a grid of size sz on each direction
sz | size of the grid on each dimensions |
Definition at line 670 of file grid_base_implementation.hpp.
|
inline |
Constructor.
It construct a grid of specified size
sz | array that indicate the size of the grid in each dimension |
Definition at line 683 of file grid_base_implementation.hpp.
|
inline |
Destructor.
Definition at line 690 of file grid_base_implementation.hpp.
|
inline |
It does nothing.
Definition at line 1357 of file grid_base_implementation.hpp.
|
inline |
copy an external grid into a specific place into this grid
It copy the area indicated by the box_src from grid_src into this grid at the place box_dst. The volume of box_src and box_dst
box_dst and box_src are adjusted if box_dst overflow the destination grid
grid_src | source grid |
box_src | source box |
box_dst | destination box |
Definition at line 1269 of file grid_base_implementation.hpp.
|
inline |
copy an external grid into a specific place into this grid
It copy the area indicated by the box_src from grid_src into this grid at the place box_dst. The volume of box_src and box_dst
grid_src | source grid |
box_src | source box |
box_dst | destination box |
Definition at line 1371 of file grid_base_implementation.hpp.
|
inline |
copy an external grid into a specific place into this grid
It copy the area indicated by the box_src from grid_src into this grid at the place box_dst. The volume of box_src and box_dst
grid_src | source grid |
box_src | source box |
box_dst | destination box |
Definition at line 1332 of file grid_base_implementation.hpp.
|
inline |
Reset the queue to remove and copy section of grids.
Definition at line 1243 of file grid_base_implementation.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 1775 of file grid_base_implementation.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 1784 of file grid_base_implementation.hpp.
|
inline |
create a duplicated version of the grid
Create a completely new grid with sz
Set the allocator and allocate the memory
1-D copy (This case is simple we use raw memory copy because is the fastest option)
N-D copy
create a source grid iterator
Definition at line 769 of file grid_base_implementation.hpp.
|
inline |
Fill the memory with the selected byte.
fl | byte pattern to fill |
Definition at line 1218 of file grid_base_implementation.hpp.
|
inline |
Get the reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 1033 of file grid_base_implementation.hpp.
|
inline |
Get the const reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 1062 of file grid_base_implementation.hpp.
|
inline |
Get the reference of the selected element.
lin_id | linearized element that identify the element in the grid |
Definition at line 1079 of file grid_base_implementation.hpp.
|
inline |
Get the const reference of the selected element.
lin_id | linearized element that identify the element in the grid |
Definition at line 1096 of file grid_base_implementation.hpp.
|
inline |
return the internal data_
return the internal data_
Definition at line 1951 of file grid_base_implementation.hpp.
|
inline |
return the internal data_
return the internal data_
Definition at line 1961 of file grid_base_implementation.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | grid_key that identify the element in the grid |
Definition at line 1117 of file grid_base_implementation.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | grid_key that identify the element in the grid |
Definition at line 1137 of file grid_base_implementation.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | linearized id that identify the element in the grid |
Definition at line 1180 of file grid_base_implementation.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | linearized id that identify the element in the grid |
Definition at line 1200 of file grid_base_implementation.hpp.
|
inline |
Get the const reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 1017 of file grid_base_implementation.hpp.
|
inline |
Get the reference of the selected element.
v1 | grid_key that identify the element in the grid |
Definition at line 983 of file grid_base_implementation.hpp.
|
inline |
|
inline |
Get the point flag (in this case just return 0)
v1 | grid_key that identify the element in the grid |
Definition at line 1049 of file grid_base_implementation.hpp.
|
inline |
Return the internal grid information.
Return the internal grid information
Definition at line 834 of file grid_base_implementation.hpp.
|
inline |
Return a grid iterator.
Return a grid iterator, to iterate through the grid
Definition at line 1759 of file grid_base_implementation.hpp.
|
inline |
Return a grid iterator over all points included between start and stop point.
Return a grid iterator over all the point with the exception of the ghost part
start | point |
stop | point |
to_init | unused bool |
Definition at line 1933 of file grid_base_implementation.hpp.
|
inline |
Return a grid iterator.
Return a grid iterator, to iterate through the grid with stencil calculation
Definition at line 1916 of file grid_base_implementation.hpp.
|
inline |
Return the memory object.
Return the memory object
p | array to retrieve |
Definition at line 867 of file grid_base_implementation.hpp.
|
inline |
Return a plain pointer to the internal data.
Return a plain pointer to the internal data
Definition at line 938 of file grid_base_implementation.hpp.
|
inline |
Return a plain pointer to the internal data.
Return a plain pointer to the internal data
Definition at line 951 of file grid_base_implementation.hpp.
|
inline |
Return a sub-grid iterator.
Return a sub-grid iterator, to iterate through the grid
start | start point |
stop | stop point |
Definition at line 1733 of file grid_base_implementation.hpp.
|
inline |
Return a sub-grid iterator.
Return a sub-grid iterator, to iterate through the grid
m | Margin |
Definition at line 1747 of file grid_base_implementation.hpp.
|
inline |
Copy the memory from host to device.
Definition at line 1854 of file grid_base_implementation.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host.
Definition at line 1844 of file grid_base_implementation.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host (respecting the NUMA domains)
Definition at line 1818 of file grid_base_implementation.hpp.
|
inline |
Synchronize the memory buffer in the device with the memory in the host (respecting the NUMA domains)
Definition at line 1793 of file grid_base_implementation.hpp.
|
inline |
In this case insert is equivalent to get.
v1 | grid_key that identify the element in the grid |
Definition at line 965 of file grid_base_implementation.hpp.
|
inline |
Get the of the selected element as a boost::fusion::vector.
Get the selected element as a boost::fusion::vector
v1 | grid_key that identify the element in the grid |
Definition at line 1160 of file grid_base_implementation.hpp.
|
inlinestatic |
Indicate that unpacking the header is supported.
Definition at line 1393 of file grid_base_implementation.hpp.
|
inline |
This function check if keep geometry is possible for this grid.
Definition at line 1252 of file grid_base_implementation.hpp.
|
inline |
It copy a grid.
g | grid to copy |
Definition at line 702 of file grid_base_implementation.hpp.
|
inline |
It copy a grid.
g | grid to copy |
Definition at line 723 of file grid_base_implementation.hpp.
|
inline |
Compare two grids.
g | grid to check |
Definition at line 743 of file grid_base_implementation.hpp.
|
inline |
Remove all the points in this region.
For this case this function does nothing
box_src | box to kill the points |
Definition at line 1235 of file grid_base_implementation.hpp.
|
inline |
Remove one element valid only on 1D.
key | element to remove |
Definition at line 1461 of file grid_base_implementation.hpp.
|
inline |
In this case it does nothing.
ctx | context |
Definition at line 1982 of file grid_base_implementation.hpp.
|
inline |
In this case it does nothing.
Definition at line 1971 of file grid_base_implementation.hpp.
|
inline |
In this case it does nothing.
ctx | context |
Definition at line 1993 of file grid_base_implementation.hpp.
|
inline |
It does nothing.
Definition at line 2000 of file grid_base_implementation.hpp.
|
inline |
Resize the grid.
Resize the grid to the old information is retained on the new grid, if the new grid is bigger. if is smaller the data are cropped
sz | reference to an array of dimension dim |
opt | options for resize. In case we know that the data are only on device memory we can use DATA_ONLY_DEVICE, In case we know that the data are only on host memory we can use DATA_ONLY_HOST |
blockSize | The default is equal to 1. In case of accelerator buffer resize indicate the size of the block of threads ( this is used in case of a vector of blocks where the block object override to operator= to distribute threads on each block element ) |
Create a completely new grid with sz
N-D copy
Definition at line 1410 of file grid_base_implementation.hpp.
|
inlineprivate |
Definition at line 556 of file grid_base_implementation.hpp.
|
inlineprivate |
create a source grid iterator
Definition at line 587 of file grid_base_implementation.hpp.
|
inlineprivate |
Set the allocator and allocate the memory
Definition at line 611 of file grid_base_implementation.hpp.
|
inline |
Resize the space.
Resize the space to a new grid, the element are retained on the new grid, if the new grid is bigger the new element are now initialized, if is smaller the data are cropped
sz | reference to an array of dimension dim |
opt | options for resize. In case we know that the data are only on device memory we can use DATA_ONLY_DEVICE, In case we know that the data are only on host memory we can use DATA_ONLY_HOST |
Create a completely new grid with sz
Definition at line 1444 of file grid_base_implementation.hpp.
|
inline |
set only some properties
key1 | destination point |
g | source |
key2 | source point |
Definition at line 1579 of file grid_base_implementation.hpp.
|
inline |
Set an element of the grid from another element of another grid.
key1 | element of the grid to set |
g | source grid |
key2 | element of the source grid to copy |
Definition at line 1681 of file grid_base_implementation.hpp.
|
inline |
Set an element of the grid from another element of another grid.
key1 | element of the grid to set |
g | source grid |
key2 | element of the source grid to copy |
Definition at line 1639 of file grid_base_implementation.hpp.
|
inline |
Set an element of the grid from another element of another grid.
key1 | element of the grid to set |
g | source grid |
key2 | element of the source grid to copy |
Definition at line 1660 of file grid_base_implementation.hpp.
|
inline |
set an element of the grid
set an element of the grid
dx | is the grid key or the position to set |
obj | value to set |
Definition at line 1597 of file grid_base_implementation.hpp.
|
inline |
set an element of the grid
set an element of the grid
dx | is the grid key or the position to set |
obj | value to set |
Definition at line 1620 of file grid_base_implementation.hpp.
|
inline |
Set an element of the grid from another element of another grid.
key1 | element of the grid to set |
g | source grid |
key2 | element of the source grid to copy |
Definition at line 1700 of file grid_base_implementation.hpp.
|
inline |
No blocks here, it does nothing.
nb | unused |
nt | unused |
Definition at line 1006 of file grid_base_implementation.hpp.
|
inline |
Create the object that provide memory.
Create the object that provide memory
S | memory type to allocate |
Definition at line 847 of file grid_base_implementation.hpp.
|
inline |
Set the object that provide memory from outside.
An external allocator is useful with allocator like PreAllocHeapMem to have contiguous in memory vectors. Or to force the system to retain memory
S | memory type |
m | external memory allocator |
Is external
Definition at line 883 of file grid_base_implementation.hpp.
|
inline |
Set the object that provide memory from outside.
An external allocator is useful with allocator like PreAllocHeapMem to have contiguous in memory vectors. Or to force the system to retain memory
S | memory type |
m | external memory allocator |
Is external
Definition at line 912 of file grid_base_implementation.hpp.
|
inline |
return the size of the grid
Definition at line 1718 of file grid_base_implementation.hpp.
|
inline |
Get the size if the grid in the direction i.
Definition at line 821 of file grid_base_implementation.hpp.
|
inline |
It move the allocated object from one grid to another.
It move the allocated object from one grid to another, after this call the argument grid is no longer valid
grid | to move/copy |
Definition at line 1567 of file grid_base_implementation.hpp.
|
inline |
It swap the objects A become B and B become A using A.swap(B);.
grid | to swap with |
Definition at line 1533 of file grid_base_implementation.hpp.
|
inline |
It swap the objects A become B and B become A using A.swap(B);.
This is a different from the standard swap and require long explanation.
This object (grid) by default when it constructs and after we call setMemory() it create an internal memory object and use it allocate memory internally. (Mode 1)
If instead we use setMemory(external_mem) this object does not create an internal memory object but use the passed object to allocate memory. (Mode 2)
External memory can be used to do memory retaining/re-use and/or garbage collection and making the data structures act like a representation of external memory
Using the structure in this way has consequences, because in Mode2 the memory (and so its life-span) is disentangled by its structure.
The problem comes when we swap object in which one the structure is in Mode2
Let's suppose object A is in Mode1 and object B is is Mode2. The normal swap, fully swap the objects
A.swap(B) A become B (in mode 2) and B become A (in mode 1)
swap nomode require that A and B have the same size.
A.swap_nomode(B) In this case the mode is not swapped A become B (in mode 1) and B become A (in mode 2). So the mode is not swapped and remain the original
grid | object B |
Definition at line 1508 of file grid_base_implementation.hpp.
|
inline |
Convert the grid into a data-structure compatible for computing into GPU.
The object created can be considered like a reference of the original
Definition at line 1890 of file grid_base_implementation.hpp.
|
inline |
Convert the grid into a data-structure compatible for computing into GPU.
The object created can be considered like a reference of the original
Definition at line 1900 of file grid_base_implementation.hpp.
|
protected |
Memory layout specification + memory chunk pointer.
Definition at line 410 of file grid_base_implementation.hpp.
|
staticconstexpr |
expose the dimansionality as a static const
Definition at line 392 of file grid_base_implementation.hpp.
|
protected |
This is a structure that store all information related to the grid and how indexes are linearized.
Definition at line 413 of file grid_base_implementation.hpp.
|
private |
Is the memory initialized.
Definition at line 418 of file grid_base_implementation.hpp.
|
private |
The memory allocator is not internally created.
Definition at line 421 of file grid_base_implementation.hpp.