OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
grid_base_impl< dim, T, S, layout_base, ord_type > Class Template Reference

Implementation of a N-dimensional grid. More...

Detailed Description

template<unsigned int dim, typename T, typename S, template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
class grid_base_impl< dim, T, S, layout_base, ord_type >

Implementation of a N-dimensional grid.

Template Parameters
dimdimansionality of the grid
Ttype store by the grid
SMemory pool from where to take the memory
layout_baselayout 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, layoutcontainer
 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, layoutget_o (const grid_key_dx< dim > &v1)
 Get the of the selected element as a boost::fusion::vector.
 
const encapc< dim, T, layoutget_o (const grid_key_dx< dim > &v1) const
 Get the of the selected element as a boost::fusion::vector.
 
encapc< dim, T, layoutinsert_o (const grid_key_dx< dim > &v1)
 Get the of the selected element as a boost::fusion::vector.
 
encapc< dim, T, layoutget_o (size_t v1)
 Get the of the selected element as a boost::fusion::vector.
 
const encapc< dim, T, layoutget_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 > &section_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_typetoKernel ()
 Convert the grid into a data-structure compatible for computing into GPU.
 
const grid_gpu_ker< dim, T_, layout_base, linearizer_typetoKernel () 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.
 
layoutget_internal_data_ ()
 return the internal data_
 
const layoutget_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.
 

Member Typedef Documentation

◆ access_key

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ background_type

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
typedef T grid_base_impl< dim, T, S, layout_base, ord_type >::background_type

Definition at line 405 of file grid_base_implementation.hpp.

◆ container

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ layout

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
typedef layout_base<T>::type grid_base_impl< dim, T, S, layout_base, ord_type >::layout
private

memory layout

Definition at line 382 of file grid_base_implementation.hpp.

◆ layout_base_

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ layout_type

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ linearizer_type

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ memory_lin

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ T_

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
typedef apply_transform<layout_base,T>::type grid_base_impl< dim, T, S, layout_base, ord_type >::T_
private

Definition at line 384 of file grid_base_implementation.hpp.

◆ T_type

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ value_type

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

◆ yes_i_am_grid

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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.

Constructor & Destructor Documentation

◆ grid_base_impl() [1/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base, ord_type >::grid_base_impl ( )
inline

Default constructor.

Definition at line 647 of file grid_base_implementation.hpp.

◆ grid_base_impl() [2/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base, ord_type >::grid_base_impl ( const grid_base_impl< dim, T, S, layout_base, ord_type > &  g)
inline

create a grid from another grid

Parameters
gthe grid to copy

Definition at line 659 of file grid_base_implementation.hpp.

◆ grid_base_impl() [3/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base, ord_type >::grid_base_impl ( const size_t &  sz)
inline

create a grid of size sz on each direction

Parameters
szsize of the grid on each dimensions

Definition at line 670 of file grid_base_implementation.hpp.

◆ grid_base_impl() [4/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base, ord_type >::grid_base_impl ( const size_t(&)  sz[dim])
inline

Constructor.

It construct a grid of specified size

Parameters
szarray that indicate the size of the grid in each dimension

Definition at line 683 of file grid_base_implementation.hpp.

◆ ~grid_base_impl()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base, ord_type >::~grid_base_impl ( )
inline

Destructor.

Definition at line 690 of file grid_base_implementation.hpp.

Member Function Documentation

◆ clear()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::clear ( )
inline

It does nothing.

Definition at line 1357 of file grid_base_implementation.hpp.

◆ copy_to()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::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 
)
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

Parameters
grid_srcsource grid
box_srcsource box
box_dstdestination box

Definition at line 1269 of file grid_base_implementation.hpp.

◆ copy_to_op()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<template< typename, typename > class op, unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::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 
)
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

Parameters
grid_srcsource grid
box_srcsource box
box_dstdestination box

Definition at line 1371 of file grid_base_implementation.hpp.

◆ copy_to_prp()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::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 
)
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

Parameters
grid_srcsource grid
box_srcsource box
box_dstdestination box

Definition at line 1332 of file grid_base_implementation.hpp.

◆ copyRemoveReset()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::copyRemoveReset ( )
inline

Reset the queue to remove and copy section of grids.

Note
for this particular implementation it does nothing

Definition at line 1243 of file grid_base_implementation.hpp.

◆ deviceToHost() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::deviceToHost ( )
inline

Synchronize the memory buffer in the device with the memory in the host.

Definition at line 1775 of file grid_base_implementation.hpp.

◆ deviceToHost() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::deviceToHost ( size_t  start,
size_t  stop 
)
inline

Synchronize the memory buffer in the device with the memory in the host.

Definition at line 1784 of file grid_base_implementation.hpp.

◆ duplicate()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base > grid_base_impl< dim, T, S, layout_base, ord_type >::duplicate ( ) const
inline

create a duplicated version of the grid

Returns
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.

◆ fill()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<int prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::fill ( unsigned char  fl)
inline

Fill the memory with the selected byte.

Warning
It is a low level memory operation it ignore any type and semantic safety
Parameters
flbyte pattern to fill

Definition at line 1218 of file grid_base_implementation.hpp.

◆ get() [1/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get<p>(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ r_type grid_base_impl< dim, T, S, layout_base, ord_type >::get ( const grid_key_dx< dim > &  v1)
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 1033 of file grid_base_implementation.hpp.

◆ get() [2/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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 grid_base_impl< dim, T, S, layout_base, ord_type >::get ( const grid_key_dx< dim > &  v1) const
inline

Get the const reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the const reference of the element

Definition at line 1062 of file grid_base_implementation.hpp.

◆ get() [3/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get_lin<p>(data_,g1,0))>
__device__ __host__ r_type grid_base_impl< dim, T, S, layout_base, ord_type >::get ( const size_t  lin_id)
inline

Get the reference of the selected element.

Parameters
lin_idlinearized element that identify the element in the grid
Returns
the reference of the element

Definition at line 1079 of file grid_base_implementation.hpp.

◆ get() [4/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get_lin<p>(data_,g1,0))>
__device__ __host__ const r_type grid_base_impl< dim, T, S, layout_base, ord_type >::get ( size_t  lin_id) const
inline

Get the const reference of the selected element.

Parameters
lin_idlinearized element that identify the element in the grid
Returns
the const reference of the element

Definition at line 1096 of file grid_base_implementation.hpp.

◆ get_internal_data_() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
layout & grid_base_impl< dim, T, S, layout_base, ord_type >::get_internal_data_ ( )
inline

return the internal data_

return the internal data_

Definition at line 1951 of file grid_base_implementation.hpp.

◆ get_internal_data_() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
const layout & grid_base_impl< dim, T, S, layout_base, ord_type >::get_internal_data_ ( ) const
inline

return the internal data_

return the internal data_

Definition at line 1961 of file grid_base_implementation.hpp.

◆ get_o() [1/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
encapc< dim, T, layout > grid_base_impl< dim, T, S, layout_base, ord_type >::get_o ( const grid_key_dx< dim > &  v1)
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1grid_key that identify the element in the grid
See also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 1117 of file grid_base_implementation.hpp.

◆ get_o() [2/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
const encapc< dim, T, layout > grid_base_impl< dim, T, S, layout_base, ord_type >::get_o ( const grid_key_dx< dim > &  v1) const
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1grid_key that identify the element in the grid
See also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 1137 of file grid_base_implementation.hpp.

◆ get_o() [3/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
encapc< dim, T, layout > grid_base_impl< dim, T, S, layout_base, ord_type >::get_o ( size_t  v1)
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1linearized id that identify the element in the grid
See also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 1180 of file grid_base_implementation.hpp.

◆ get_o() [4/4]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
const encapc< dim, T, layout > grid_base_impl< dim, T, S, layout_base, ord_type >::get_o ( size_t  v1) const
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1linearized id that identify the element in the grid
See also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 1200 of file grid_base_implementation.hpp.

◆ get_unsafe()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
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 grid_base_impl< dim, T, S, layout_base, ord_type >::get_unsafe ( const grid_key_dx< dim > &  v1) const
inline

Get the const reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the const reference of the element

Definition at line 1017 of file grid_base_implementation.hpp.

◆ get_usafe()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get<p>(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ r_type grid_base_impl< dim, T, S, layout_base, ord_type >::get_usafe ( const grid_key_dx< dim > &  v1)
inline

Get the reference of the selected element.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 983 of file grid_base_implementation.hpp.

◆ getBlockEdgeSize()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
int grid_base_impl< dim, T, S, layout_base, ord_type >::getBlockEdgeSize ( )
inline

No blocks here, it return 1.

Returns
1

Definition at line 995 of file grid_base_implementation.hpp.

◆ getFlag()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
__device__ __host__ unsigned char grid_base_impl< dim, T, S, layout_base, ord_type >::getFlag ( const grid_key_dx< dim > &  v1) const
inline

Get the point flag (in this case just return 0)

Parameters
v1grid_key that identify the element in the grid
Returns
zero

Definition at line 1049 of file grid_base_implementation.hpp.

◆ getGrid()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
const ord_type & grid_base_impl< dim, T, S, layout_base, ord_type >::getGrid ( ) const
inline

Return the internal grid information.

Return the internal grid information

Returns
the internal grid

Definition at line 834 of file grid_base_implementation.hpp.

◆ getIterator() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_key_dx_iterator< dim > grid_base_impl< dim, T, S, layout_base, ord_type >::getIterator ( ) const
inline

Return a grid iterator.

Return a grid iterator, to iterate through the grid

Returns
a grid iterator

Definition at line 1759 of file grid_base_implementation.hpp.

◆ getIterator() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_key_dx_iterator_sub< dim > grid_base_impl< dim, T, S, layout_base, ord_type >::getIterator ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop,
bool  to_init = false 
) const
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

Parameters
startpoint
stoppoint
to_initunused bool
Returns
a sub-grid iterator

Definition at line 1933 of file grid_base_implementation.hpp.

◆ getIteratorStencil()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int Np>
grid_key_dx_iterator< dim, stencil_offset_compute< dim, Np > > grid_base_impl< dim, T, S, layout_base, ord_type >::getIteratorStencil ( const grid_key_dx< dim >(&)  stencil_pnt[Np]) const
inline

Return a grid iterator.

Return a grid iterator, to iterate through the grid with stencil calculation

Returns
a grid iterator with stencil calculation

Definition at line 1916 of file grid_base_implementation.hpp.

◆ getMemory()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p>
auto grid_base_impl< dim, T, S, layout_base, ord_type >::getMemory ( ) -> decltype(boost::fusion::at_c<p>(data_).getMemory())
inline

Return the memory object.

Return the memory object

Template Parameters
parray to retrieve

Definition at line 867 of file grid_base_implementation.hpp.

◆ getPointer() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p = 0>
void * grid_base_impl< dim, T, S, layout_base, ord_type >::getPointer ( )
inline

Return a plain pointer to the internal data.

Return a plain pointer to the internal data

Returns
plain data pointer

Definition at line 938 of file grid_base_implementation.hpp.

◆ getPointer() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p = 0>
const void * grid_base_impl< dim, T, S, layout_base, ord_type >::getPointer ( ) const
inline

Return a plain pointer to the internal data.

Return a plain pointer to the internal data

Returns
plain data pointer

Definition at line 951 of file grid_base_implementation.hpp.

◆ getSubIterator() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_key_dx_iterator_sub< dim > grid_base_impl< dim, T, S, layout_base, ord_type >::getSubIterator ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop 
) const
inline

Return a sub-grid iterator.

Return a sub-grid iterator, to iterate through the grid

Parameters
startstart point
stopstop point
Returns
a sub-grid iterator

Definition at line 1733 of file grid_base_implementation.hpp.

◆ getSubIterator() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_key_dx_iterator_sub< dim > grid_base_impl< dim, T, S, layout_base, ord_type >::getSubIterator ( size_t  m)
inline

Return a sub-grid iterator.

Return a sub-grid iterator, to iterate through the grid

Parameters
mMargin
Returns
a sub-grid iterator

Definition at line 1747 of file grid_base_implementation.hpp.

◆ hostToDevice() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::hostToDevice ( )
inline

Copy the memory from host to device.

Definition at line 1854 of file grid_base_implementation.hpp.

◆ hostToDevice() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::hostToDevice ( size_t  start,
size_t  stop 
)
inline

Synchronize the memory buffer in the device with the memory in the host.

Definition at line 1844 of file grid_base_implementation.hpp.

◆ hostToDeviceNUMA() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::hostToDeviceNUMA ( )
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.

◆ hostToDeviceNUMA() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
void grid_base_impl< dim, T, S, layout_base, ord_type >::hostToDeviceNUMA ( size_t  start,
size_t  stop 
)
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.

◆ insert()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p, typename r_type = decltype(layout_base<T>::template get<p>(data_,g1,grid_key_dx<dim>()))>
r_type grid_base_impl< dim, T, S, layout_base, ord_type >::insert ( const grid_key_dx< dim > &  v1)
inline

In this case insert is equivalent to get.

Parameters
v1grid_key that identify the element in the grid
Returns
the reference of the element

Definition at line 965 of file grid_base_implementation.hpp.

◆ insert_o()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
encapc< dim, T, layout > grid_base_impl< dim, T, S, layout_base, ord_type >::insert_o ( const grid_key_dx< dim > &  v1)
inline

Get the of the selected element as a boost::fusion::vector.

Get the selected element as a boost::fusion::vector

Parameters
v1grid_key that identify the element in the grid
See also
encap_c
Returns
an encap_c that is the representation of the object (careful is not the object)

Definition at line 1160 of file grid_base_implementation.hpp.

◆ is_unpack_header_supported()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
static bool grid_base_impl< dim, T, S, layout_base, ord_type >::is_unpack_header_supported ( )
inlinestatic

Indicate that unpacking the header is supported.

Returns
false

Definition at line 1393 of file grid_base_implementation.hpp.

◆ isSkipLabellingPossible()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
bool grid_base_impl< dim, T, S, layout_base, ord_type >::isSkipLabellingPossible ( )
inline

This function check if keep geometry is possible for this grid.

Returns
false it does not exist this feature on this type of grids

Definition at line 1252 of file grid_base_implementation.hpp.

◆ operator=() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base > & grid_base_impl< dim, T, S, layout_base, ord_type >::operator= ( const grid_base_impl< dim, T, S, layout_base > &  g)
inline

It copy a grid.

Parameters
ggrid to copy
Returns
itself

Definition at line 702 of file grid_base_implementation.hpp.

◆ operator=() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_base_impl< dim, T, S, layout_base > & grid_base_impl< dim, T, S, layout_base, ord_type >::operator= ( grid_base_impl< dim, T, S, layout_base > &&  g)
inline

It copy a grid.

Parameters
ggrid to copy
Returns
itself

Definition at line 723 of file grid_base_implementation.hpp.

◆ operator==()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
bool grid_base_impl< dim, T, S, layout_base, ord_type >::operator== ( const grid_base_impl< dim, T, S, layout_base > &  g)
inline

Compare two grids.

Parameters
ggrid to check
Returns
true if they match

Definition at line 743 of file grid_base_implementation.hpp.

◆ remove() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::remove ( Box< dim, long int > &  section_to_delete)
inline

Remove all the points in this region.

For this case this function does nothing

Parameters
box_srcbox to kill the points

Definition at line 1235 of file grid_base_implementation.hpp.

◆ remove() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::remove ( size_t  key)
inline

Remove one element valid only on 1D.

Parameters
keyelement to remove

Definition at line 1461 of file grid_base_implementation.hpp.

◆ removeAddUnpackFinalize()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp, typename context_type >
void grid_base_impl< dim, T, S, layout_base, ord_type >::removeAddUnpackFinalize ( const context_type &  ctx,
int  opt 
)
inline

In this case it does nothing.

Note
this function exist to respect the interface to work as distributed
Parameters
ctxcontext

Definition at line 1982 of file grid_base_implementation.hpp.

◆ removeAddUnpackReset()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::removeAddUnpackReset ( )
inline

In this case it does nothing.

Note
this function exist to respect the interface to work as distributed

Definition at line 1971 of file grid_base_implementation.hpp.

◆ removeCopyToFinalize()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp, typename context_type >
void grid_base_impl< dim, T, S, layout_base, ord_type >::removeCopyToFinalize ( const context_type &  ctx,
int  opt 
)
inline

In this case it does nothing.

Note
this function exist to respect the interface to work as distributed
Parameters
ctxcontext

Definition at line 1993 of file grid_base_implementation.hpp.

◆ resetFlush()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::resetFlush ( )
inline

It does nothing.

Definition at line 2000 of file grid_base_implementation.hpp.

◆ resize()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::resize ( const size_t(&)  sz[dim],
size_t  opt = DATA_ON_HOST | DATA_ON_DEVICE,
unsigned int  blockSize = 1 
)
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

Parameters
szreference to an array of dimension dim
optoptions 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
blockSizeThe 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.

◆ resize_impl_device()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::resize_impl_device ( const size_t(&)  sz[dim],
grid_base_impl< dim, T, S, layout_base, ord_type > &  grid_new,
unsigned int  blockSize = 1 
)
inlineprivate

Definition at line 556 of file grid_base_implementation.hpp.

◆ resize_impl_host()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::resize_impl_host ( const size_t(&)  sz[dim],
grid_base_impl< dim, T, S, layout_base, ord_type > &  grid_new 
)
inlineprivate

create a source grid iterator

Definition at line 587 of file grid_base_implementation.hpp.

◆ resize_impl_memset()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::resize_impl_memset ( grid_base_impl< dim, T, S, layout_base, ord_type > &  grid_new)
inlineprivate

Set the allocator and allocate the memory

Definition at line 611 of file grid_base_implementation.hpp.

◆ resize_no_device()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::resize_no_device ( const size_t(&)  sz[dim])
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

Parameters
szreference to an array of dimension dim
optoptions 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.

◆ set() [1/6]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int ... prp>
__device__ __host__ void grid_base_impl< dim, T, S, layout_base, ord_type >::set ( const grid_key_dx< dim > &  key1,
const grid_base_impl< dim, T, S, layout_base, ord_type > &  g,
const grid_key_dx< dim > &  key2 
)
inline

set only some properties

Parameters
key1destination point
gsource
key2source point

Definition at line 1579 of file grid_base_implementation.hpp.

◆ set() [2/6]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<typename Mem >
void grid_base_impl< dim, T, S, layout_base, ord_type >::set ( const grid_key_dx< dim > &  key1,
const grid_base_impl< dim, T, Mem, layout_base > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 1681 of file grid_base_implementation.hpp.

◆ set() [3/6]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::set ( const grid_key_dx< dim > &  key1,
const grid_base_impl< dim, T, S, layout_base > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 1639 of file grid_base_implementation.hpp.

◆ set() [4/6]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::set ( const size_t  key1,
const grid_base_impl< dim, T, S, layout_base > &  g,
const size_t  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 1660 of file grid_base_implementation.hpp.

◆ set() [5/6]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<typename Memory >
void grid_base_impl< dim, T, S, layout_base, ord_type >::set ( grid_key_dx< dim >  dx,
const encapc< 1, T, Memory > &  obj 
)
inline

set an element of the grid

set an element of the grid

Parameters
dxis the grid key or the position to set
objvalue to set

Definition at line 1597 of file grid_base_implementation.hpp.

◆ set() [6/6]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::set ( grid_key_dx< dim >  dx,
const T &  obj 
)
inline

set an element of the grid

set an element of the grid

Parameters
dxis the grid key or the position to set
objvalue to set

Definition at line 1620 of file grid_base_implementation.hpp.

◆ set_general()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<typename Mem , template< typename > class layout_base2>
void grid_base_impl< dim, T, S, layout_base, ord_type >::set_general ( const grid_key_dx< dim > &  key1,
const grid_base_impl< dim, T, Mem, layout_base2 > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Set an element of the grid from another element of another grid.

Parameters
key1element of the grid to set
gsource grid
key2element of the source grid to copy

Definition at line 1700 of file grid_base_implementation.hpp.

◆ setGPUInsertBuffer()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::setGPUInsertBuffer ( unsigned int  nb,
unsigned int  nt 
)
inline

No blocks here, it does nothing.

Parameters
nbunused
ntunused

Definition at line 1006 of file grid_base_implementation.hpp.

◆ setMemory() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::setMemory ( )
inline

Create the object that provide memory.

Create the object that provide memory

Template Parameters
Smemory type to allocate

Definition at line 847 of file grid_base_implementation.hpp.

◆ setMemory() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
template<unsigned int p = 0>
void grid_base_impl< dim, T, S, layout_base, ord_type >::setMemory ( S &  m)
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

Template Parameters
Smemory type
Parameters
mexternal memory allocator

Is external

Definition at line 883 of file grid_base_implementation.hpp.

◆ setMemoryArray()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::setMemoryArray ( S *  m)
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

Template Parameters
Smemory type
Parameters
mexternal memory allocator

Is external

Definition at line 912 of file grid_base_implementation.hpp.

◆ size() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
size_t grid_base_impl< dim, T, S, layout_base, ord_type >::size ( ) const
inline

return the size of the grid

Returns
Return the size of the grid

Definition at line 1718 of file grid_base_implementation.hpp.

◆ size() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
int grid_base_impl< dim, T, S, layout_base, ord_type >::size ( int  i) const
inline

Get the size if the grid in the direction i.

Definition at line 821 of file grid_base_implementation.hpp.

◆ swap() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::swap ( grid_base_impl< dim, T, S, layout_base > &&  grid)
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

Parameters
gridto move/copy

Definition at line 1567 of file grid_base_implementation.hpp.

◆ swap() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::swap ( grid_base_impl< dim, T, S, layout_base, ord_type > &  grid)
inline

It swap the objects A become B and B become A using A.swap(B);.

Parameters
gridto swap with

Definition at line 1533 of file grid_base_implementation.hpp.

◆ swap_nomode()

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
void grid_base_impl< dim, T, S, layout_base, ord_type >::swap_nomode ( grid_base_impl< dim, T, S, layout_base > &  grid)
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

Parameters
gridobject B

Definition at line 1508 of file grid_base_implementation.hpp.

◆ toKernel() [1/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
grid_gpu_ker< dim, T_, layout_base, linearizer_type > grid_base_impl< dim, T, S, layout_base, ord_type >::toKernel ( )
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.

◆ toKernel() [2/2]

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
const grid_gpu_ker< dim, T_, layout_base, linearizer_type > grid_base_impl< dim, T, S, layout_base, ord_type >::toKernel ( ) const
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.

Field Documentation

◆ data_

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
layout grid_base_impl< dim, T, S, layout_base, ord_type >::data_
protected

Memory layout specification + memory chunk pointer.

Definition at line 410 of file grid_base_implementation.hpp.

◆ dims

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
constexpr unsigned int grid_base_impl< dim, T, S, layout_base, ord_type >::dims = dim
staticconstexpr

expose the dimansionality as a static const

Definition at line 392 of file grid_base_implementation.hpp.

◆ g1

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
ord_type grid_base_impl< dim, T, S, layout_base, ord_type >::g1
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.

◆ is_mem_init

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
bool grid_base_impl< dim, T, S, layout_base, ord_type >::is_mem_init = false
private

Is the memory initialized.

Definition at line 418 of file grid_base_implementation.hpp.

◆ isExternal

template<unsigned int dim, typename T , typename S , template< typename > class layout_base, typename ord_type = grid_sm<dim,void>>
bool grid_base_impl< dim, T, S, layout_base, ord_type >::isExternal
private

The memory allocator is not internally created.

Definition at line 421 of file grid_base_implementation.hpp.


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