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

grid interface available when on gpu More...

Detailed Description

template<unsigned int dim, typename T, template< typename > class layout_base, typename linearizer>
class grid_gpu_ker< dim, T, layout_base, linearizer >

grid interface available when on gpu

Template Parameters
n_bufnumber of template buffers

Definition at line 149 of file map_grid_cuda_ker.cuh.

Public Types

typedef int yes_i_am_grid
 it define that it is a grid
 
typedef T value_type
 Type of the value the vector is storing.
 

Public Member Functions

__device__ __host__ grid_gpu_ker (const linearizer &g1)
 
__device__ __host__ grid_gpu_ker (const grid_gpu_ker &cpy)
 
__device__ __host__ void constructor_impl (const grid_gpu_ker &cpy)
 
__device__ __host__ void constructor_impl (const grid_gpu_ker_ref< dim, T, layout_base, linearizer > &cpy)
 
__device__ __host__ const grid_sm< dim, void > & getGrid () const
 Return the internal grid information.
 
template<unsigned int p, typename ids_type , 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, ids_type > &v1)
 Get the reference of the selected element.
 
template<unsigned int p, typename ids_type , typename r_type = decltype(layout_base<T_>::template get<p>(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ r_type get_debug (const grid_key_dx< dim, ids_type > &v1) const
 Get the const reference of the selected element.
 
template<unsigned int p, typename ids_type , 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, ids_type > &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.
 
template<typename Tk >
__device__ encapc< dim, T_, layoutget_o (const grid_key_dx< dim, Tk > &v1)
 Get the of the selected element as a boost::fusion::vector.
 
template<typename Tk >
__device__ const encapc< dim, T_, layoutget_o (const grid_key_dx< dim, Tk > &v1) const
 Get the of the selected element as a boost::fusion::vector.
 
__device__ void set (const grid_key_dx< dim > &key1, const grid_gpu_ker< dim, T_, layout_base, linearizer > &g, const grid_key_dx< dim > &key2)
 
template<unsigned int ... prp>
__device__ void set (const grid_key_dx< dim > &key1, const grid_gpu_ker< dim, T_, layout_base, linearizer > &g, const grid_key_dx< dim > &key2)
 
template<typename Memory >
__device__ void set (grid_key_dx< dim > key1, const encapc< 1, T, Memory > &obj)
 set an element of the grid
 
template<unsigned int p>
__device__ __host__ void * getPointer ()
 Get the pointer for the property p.
 
template<unsigned int p>
__device__ __host__ const void * getPointer () const
 Get the pointer for the property p.
 
grid_gpu_ker< dim, T_, layout_base, linearizer > & operator= (const grid_gpu_ker< dim, T_, layout_base, linearizer > &g)
 operator= this operator absorb the pointers, consider that this object wrap device pointers
 
struct ite_gpu< dim > getGPUIterator (grid_key_dx< dim > &key1, grid_key_dx< dim > &key2, size_t n_thr=default_kernel_wg_threads_) const
 Get an iterator for the GPU.
 
__device__ __host__ layoutget_data_ ()
 Get the internal data_ structure.
 
__device__ __host__ const layoutget_data_ () const
 Get the internal data_ structure.
 

Private Types

typedef apply_transform< layout_base, T >::type T_
 Type T.
 
typedef layout_base< T_ >::type layout
 type of layout of the structure
 

Private Member Functions

template<typename ids_type >
__device__ __host__ bool check_bound (const grid_key_dx< dim, ids_type > &v1) const
 Check that the key is inside the grid.
 
__device__ __host__ bool check_bound (size_t v1) const
 Check that the key is inside the grid.
 

Private Attributes

linearizer g1
 grid information
 
layout data_
 layout data
 

Member Typedef Documentation

◆ layout

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
typedef layout_base<T_>::type grid_gpu_ker< dim, T, layout_base, linearizer >::layout
private

type of layout of the structure

Definition at line 158 of file map_grid_cuda_ker.cuh.

◆ T_

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
typedef apply_transform<layout_base,T>::type grid_gpu_ker< dim, T, layout_base, linearizer >::T_
private

Type T.

Definition at line 152 of file map_grid_cuda_ker.cuh.

◆ value_type

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
typedef T grid_gpu_ker< dim, T, layout_base, linearizer >::value_type

Type of the value the vector is storing.

Definition at line 202 of file map_grid_cuda_ker.cuh.

◆ yes_i_am_grid

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
typedef int grid_gpu_ker< dim, T, layout_base, linearizer >::yes_i_am_grid

it define that it is a grid

Definition at line 199 of file map_grid_cuda_ker.cuh.

Constructor & Destructor Documentation

◆ grid_gpu_ker() [1/3]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ grid_gpu_ker< dim, T, layout_base, linearizer >::grid_gpu_ker ( )
inline

Definition at line 204 of file map_grid_cuda_ker.cuh.

◆ grid_gpu_ker() [2/3]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ grid_gpu_ker< dim, T, layout_base, linearizer >::grid_gpu_ker ( const linearizer &  g1)
inline

Definition at line 207 of file map_grid_cuda_ker.cuh.

◆ grid_gpu_ker() [3/3]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ grid_gpu_ker< dim, T, layout_base, linearizer >::grid_gpu_ker ( const grid_gpu_ker< dim, T, layout_base, linearizer > &  cpy)
inline

Definition at line 212 of file map_grid_cuda_ker.cuh.

Member Function Documentation

◆ check_bound() [1/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<typename ids_type >
__device__ __host__ bool grid_gpu_ker< dim, T, layout_base, linearizer >::check_bound ( const grid_key_dx< dim, ids_type > &  v1) const
inlineprivate

Check that the key is inside the grid.

Parameters
key
Returns

Definition at line 172 of file map_grid_cuda_ker.cuh.

◆ check_bound() [2/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ bool grid_gpu_ker< dim, T, layout_base, linearizer >::check_bound ( size_t  v1) const
inlineprivate

Check that the key is inside the grid.

Parameters
key
Returns
true if it is bound

Definition at line 191 of file map_grid_cuda_ker.cuh.

◆ constructor_impl() [1/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ void grid_gpu_ker< dim, T, layout_base, linearizer >::constructor_impl ( const grid_gpu_ker< dim, T, layout_base, linearizer > &  cpy)
inline

Definition at line 218 of file map_grid_cuda_ker.cuh.

◆ constructor_impl() [2/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ void grid_gpu_ker< dim, T, layout_base, linearizer >::constructor_impl ( const grid_gpu_ker_ref< dim, T, layout_base, linearizer > &  cpy)
inline

Definition at line 224 of file map_grid_cuda_ker.cuh.

◆ get() [1/4]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p, typename ids_type , typename r_type = decltype(layout_base<T_>::template get<p>(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ r_type grid_gpu_ker< dim, T, layout_base, linearizer >::get ( const grid_key_dx< dim, ids_type > &  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 250 of file map_grid_cuda_ker.cuh.

◆ get() [2/4]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p, typename ids_type , typename r_type = decltype(layout_base<T_>::template get<p>(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ r_type grid_gpu_ker< dim, T, layout_base, linearizer >::get ( const grid_key_dx< dim, ids_type > &  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 286 of file map_grid_cuda_ker.cuh.

◆ get() [3/4]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p, typename r_type = decltype(layout_base<T_>::template get_lin<p>(data_,g1,0))>
__device__ __host__ r_type grid_gpu_ker< dim, T, layout_base, linearizer >::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 303 of file map_grid_cuda_ker.cuh.

◆ get() [4/4]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p, typename r_type = decltype(layout_base<T_>::template get_lin<p>(data_,g1,0))>
__device__ __host__ const r_type grid_gpu_ker< dim, T, layout_base, linearizer >::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 320 of file map_grid_cuda_ker.cuh.

◆ get_data_() [1/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ layout & grid_gpu_ker< dim, T, layout_base, linearizer >::get_data_ ( )
inline

Get the internal data_ structure.

Returns
the data_ structure

Definition at line 473 of file map_grid_cuda_ker.cuh.

◆ get_data_() [2/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ const layout & grid_gpu_ker< dim, T, layout_base, linearizer >::get_data_ ( ) const
inline

Get the internal data_ structure.

Returns
the data_ structure

Definition at line 483 of file map_grid_cuda_ker.cuh.

◆ get_debug()

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p, typename ids_type , typename r_type = decltype(layout_base<T_>::template get<p>(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ r_type grid_gpu_ker< dim, T, layout_base, linearizer >::get_debug ( const grid_key_dx< dim, ids_type > &  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 268 of file map_grid_cuda_ker.cuh.

◆ get_o() [1/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<typename Tk >
__device__ encapc< dim, T_, layout > grid_gpu_ker< dim, T, layout_base, linearizer >::get_o ( const grid_key_dx< dim, Tk > &  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 341 of file map_grid_cuda_ker.cuh.

◆ get_o() [2/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<typename Tk >
__device__ const encapc< dim, T_, layout > grid_gpu_ker< dim, T, layout_base, linearizer >::get_o ( const grid_key_dx< dim, Tk > &  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 362 of file map_grid_cuda_ker.cuh.

◆ getGPUIterator()

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
struct ite_gpu< dim > grid_gpu_ker< dim, T, layout_base, linearizer >::getGPUIterator ( grid_key_dx< dim > &  key1,
grid_key_dx< dim > &  key2,
size_t  n_thr = default_kernel_wg_threads_ 
) const
inline

Get an iterator for the GPU.

Parameters
startstarting point
stopend point

Definition at line 463 of file map_grid_cuda_ker.cuh.

◆ getGrid()

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ __host__ const grid_sm< dim, void > & grid_gpu_ker< dim, T, layout_base, linearizer >::getGrid ( ) const
inline

Return the internal grid information.

Return the internal grid information

Returns
the internal grid

Definition at line 237 of file map_grid_cuda_ker.cuh.

◆ getPointer() [1/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p>
__device__ __host__ void * grid_gpu_ker< dim, T, layout_base, linearizer >::getPointer ( )
inline

Get the pointer for the property p.

Template Parameters
propertyp

Definition at line 428 of file map_grid_cuda_ker.cuh.

◆ getPointer() [2/2]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int p>
__device__ __host__ const void * grid_gpu_ker< dim, T, layout_base, linearizer >::getPointer ( ) const
inline

Get the pointer for the property p.

Template Parameters
propertyp

Definition at line 438 of file map_grid_cuda_ker.cuh.

◆ operator=()

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
grid_gpu_ker< dim, T_, layout_base, linearizer > & grid_gpu_ker< dim, T, layout_base, linearizer >::operator= ( const grid_gpu_ker< dim, T_, layout_base, linearizer > &  g)
inline

operator= this operator absorb the pointers, consider that this object wrap device pointers

Parameters
objectto copy

Definition at line 448 of file map_grid_cuda_ker.cuh.

◆ set() [1/3]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
__device__ void grid_gpu_ker< dim, T, layout_base, linearizer >::set ( const grid_key_dx< dim > &  key1,
const grid_gpu_ker< dim, T_, layout_base, linearizer > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Definition at line 372 of file map_grid_cuda_ker.cuh.

◆ set() [2/3]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<unsigned int ... prp>
__device__ void grid_gpu_ker< dim, T, layout_base, linearizer >::set ( const grid_key_dx< dim > &  key1,
const grid_gpu_ker< dim, T_, layout_base, linearizer > &  g,
const grid_key_dx< dim > &  key2 
)
inline

Definition at line 386 of file map_grid_cuda_ker.cuh.

◆ set() [3/3]

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
template<typename Memory >
__device__ void grid_gpu_ker< dim, T, layout_base, linearizer >::set ( grid_key_dx< dim >  key1,
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 413 of file map_grid_cuda_ker.cuh.

Field Documentation

◆ data_

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
layout grid_gpu_ker< dim, T, layout_base, linearizer >::data_
mutableprivate

layout data

Definition at line 161 of file map_grid_cuda_ker.cuh.

◆ g1

template<unsigned int dim, typename T , template< typename > class layout_base, typename linearizer >
linearizer grid_gpu_ker< dim, T, layout_base, linearizer >::g1
private

grid information

Definition at line 155 of file map_grid_cuda_ker.cuh.


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