OpenFPM_pdata  3.0.0
Project that contain the implementation of distributed structures
openfpm::vector_sparse_gpu_ker< T, Ti, layout_base > Class Template Reference

Detailed Description

template<typename T, typename Ti, template< typename > class layout_base>
class openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >

Definition at line 44 of file map_vector_sparse_cuda_ker.cuh.

Public Types

typedef Ti index_type
 
typedef int yes_has_check_device_pointer
 Indicate this structure has a function to check the device pointer.
 

Public Member Functions

 vector_sparse_gpu_ker (vector_gpu_ker< aggregate< Ti >, layout_base > vct_index, vector_gpu_ker< T, layout_base > vct_data, vector_gpu_ker< aggregate< Ti >, layout_base > vct_add_index, vector_gpu_ker< aggregate< Ti >, layout_base > vct_rem_index, vector_gpu_ker< T, layout_base > vct_add_data, vector_gpu_ker< aggregate< Ti >, layout_base > vct_nadd_index, vector_gpu_ker< aggregate< Ti >, layout_base > vct_nrem_index, int nslot_add, int nslot_rem)
 
__device__ int size ()
 Get the number of elements. More...
 
__device__ void init ()
 This function must be called. More...
 
__device__ void init_ins_inc ()
 This function must be called. More...
 
__device__ void init_rem_inc ()
 This function must be called. More...
 
__device__ openfpm::sparse_index< Ti > get_sparse (Ti id) const
 Get the sparse index. More...
 
template<unsigned int p>
__device__ auto getBackground () const -> decltype(vct_data.template get< p >(0)) &
 Get the background value.
 
template<unsigned int p>
__device__ auto get (Ti id) const -> decltype(vct_data.template get< p >(id))
 Get an element of the vector. More...
 
__device__ auto get (Ti id) const -> decltype(vct_data.get(0))
 
template<unsigned int p>
__device__ auto get (openfpm::sparse_index< Ti > id) const -> decltype(vct_data.template get< p >(id.id))
 Get an element of the vector. More...
 
template<unsigned int p>
__device__ auto get (openfpm::sparse_index< Ti > id) -> decltype(vct_data.template get< p >(id.id))
 Get an element of the vector. More...
 
__device__ Ti get_index (openfpm::sparse_index< Ti > id) const
 Get the index associated to the element id. More...
 
template<unsigned int p>
__device__ auto get (Ti id, Ti &di) const -> decltype(vct_data.template get< p >(id))
 Get an element of the vector. More...
 
template<unsigned int p>
__device__ auto get_ele (Ti di) const -> decltype(vct_data.template get< p >(di))
 Get an element of the vector. More...
 
template<unsigned int p>
__device__ auto insert (Ti ele) -> decltype(vct_data.template get< p >(0))
 It insert an element in the sparse vector. More...
 
__device__ void remove (Ti ele)
 It insert an element in the sparse vector. More...
 
__device__ auto insert (Ti ele) -> decltype(vct_add_data.get(0))
 It insert an element in the sparse vector. More...
 
__device__ void remove_b (Ti ele, Ti slot_base)
 It insert an element in the sparse vector. More...
 
template<unsigned int p>
__device__ auto insert_b (Ti ele, Ti slot_base) -> decltype(vct_data.template get< p >(0))
 It insert an element in the sparse vector. More...
 
__device__ auto insert_b (Ti ele, Ti slot_base) -> decltype(vct_add_data.get(0))
 It insert an element in the sparse vector. More...
 
__device__ void flush_block_insert ()
 It insert an element in the sparse vector. More...
 
__device__ void flush_block_remove ()
 It insert an element in the sparse vector. More...
 
__device__ void flush_block_insert (Ti b, bool flusher)
 It insert an element in the sparse vector. More...
 
__device__ auto private_get_data () -> decltype(vct_add_data.getBase().get_data_())
 
__device__ void flush_block_remove (unsigned int b, bool flusher)
 It insert an element in the sparse vector. More...
 
__device__ auto getAddDataBuffer () -> decltype(vct_add_data)&
 Get the data buffer. More...
 
__device__ auto getDataBuffer () -> decltype(vct_data)&
 Get the data buffer. More...
 
__device__ auto getAddIndexBuffer () const -> const decltype(vct_add_index)&
 Get the indices buffer. More...
 
__device__ auto getIndexBuffer () const -> const decltype(vct_index)&
 Get the indices buffer. More...
 
__device__ auto getDataBuffer () const -> const decltype(vct_data)&
 Get the data buffer. More...
 

Private Member Functions

__device__ void _branchfree_search (Ti x, Ti &id) const
 get the element i More...
 

Private Attributes

vector_gpu_ker< aggregate< Ti >, layout_base > vct_index
 
vector_gpu_ker< T, layout_base > vct_data
 
vector_gpu_ker< aggregate< Ti >, layout_base > vct_add_index
 
vector_gpu_ker< aggregate< Ti >, layout_base > vct_rem_index
 
vector_gpu_ker< aggregate< Ti >, layout_base > vct_nadd_index
 
vector_gpu_ker< aggregate< Ti >, layout_base > vct_nrem_index
 
vector_gpu_ker< T, layout_base > vct_add_data
 
int nslot_add
 
int nslot_rem
 

Member Function Documentation

◆ _branchfree_search()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::_branchfree_search ( Ti  x,
Ti &  id 
) const
inlineprivate

get the element i

search the element x

Parameters
ielement i

Definition at line 73 of file map_vector_sparse_cuda_ker.cuh.

◆ flush_block_insert() [1/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::flush_block_insert ( )
inline

It insert an element in the sparse vector.

Definition at line 420 of file map_vector_sparse_cuda_ker.cuh.

◆ flush_block_insert() [2/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::flush_block_insert ( Ti  b,
bool  flusher 
)
inline

It insert an element in the sparse vector.

Definition at line 462 of file map_vector_sparse_cuda_ker.cuh.

◆ flush_block_remove() [1/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::flush_block_remove ( )
inline

It insert an element in the sparse vector.

Definition at line 441 of file map_vector_sparse_cuda_ker.cuh.

◆ flush_block_remove() [2/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::flush_block_remove ( unsigned int  b,
bool  flusher 
)
inline

It insert an element in the sparse vector.

Definition at line 486 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [1/4]

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get ( Ti  id) const -> decltype(vct_data.template get<p>(id))
inline

Get an element of the vector.

Get an element of the vector

Template Parameters
pProperty to get
Parameters
idElement to get
Returns
the element value requested

Definition at line 212 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [2/4]

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get ( openfpm::sparse_index< Ti >  id) const -> decltype(vct_data.template get<p>(id.id))
inline

Get an element of the vector.

Get an element of the vector

Template Parameters
pProperty to get
Parameters
idElement to get
Returns
the element value requested

Definition at line 237 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [3/4]

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get ( openfpm::sparse_index< Ti >  id) -> decltype(vct_data.template get<p>(id.id))
inline

Get an element of the vector.

Get an element of the vector

Template Parameters
pProperty to get
Parameters
idElement to get
Returns
the element value requested

Definition at line 253 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [4/4]

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get ( Ti  id,
Ti &  di 
) const -> decltype(vct_data.template get<p>(id))
inline

Get an element of the vector.

Get an element of the vector

Template Parameters
pProperty to get
Parameters
idElement to get
Returns
the element value requested

Definition at line 280 of file map_vector_sparse_cuda_ker.cuh.

◆ get_ele()

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get_ele ( Ti  di) const -> decltype(vct_data.template get<p>(di))
inline

Get an element of the vector.

Get an element of the vector

Template Parameters
pProperty to get
Parameters
idElement to get
Returns
the element value requested

Definition at line 297 of file map_vector_sparse_cuda_ker.cuh.

◆ get_index()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ Ti openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get_index ( openfpm::sparse_index< Ti >  id) const
inline

Get the index associated to the element id.

Returns
the element value requested

Definition at line 264 of file map_vector_sparse_cuda_ker.cuh.

◆ get_sparse()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ openfpm::sparse_index<Ti> openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::get_sparse ( Ti  id) const
inline

Get the sparse index.

Get the sparse index of the element id

Note
use get_index and get to retrieve the value index associated to the sparse index
Parameters
idElement to get
Returns
the element value requested

Definition at line 183 of file map_vector_sparse_cuda_ker.cuh.

◆ getAddDataBuffer()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::getAddDataBuffer ( ) -> decltype(vct_add_data)&
inline

Get the data buffer.

Returns
the reference to the data buffer

Definition at line 504 of file map_vector_sparse_cuda_ker.cuh.

◆ getAddIndexBuffer()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::getAddIndexBuffer ( ) const -> const decltype(vct_add_index)&
inline

Get the indices buffer.

Returns
the reference to the indices buffer

Definition at line 522 of file map_vector_sparse_cuda_ker.cuh.

◆ getDataBuffer() [1/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::getDataBuffer ( ) -> decltype(vct_data)&
inline

Get the data buffer.

Returns
the reference to the data buffer

Definition at line 513 of file map_vector_sparse_cuda_ker.cuh.

◆ getDataBuffer() [2/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::getDataBuffer ( ) const -> const decltype(vct_data)&
inline

Get the data buffer.

Returns
the reference to the data buffer

Definition at line 540 of file map_vector_sparse_cuda_ker.cuh.

◆ getIndexBuffer()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::getIndexBuffer ( ) const -> const decltype(vct_index)&
inline

Get the indices buffer.

Returns
the reference to the indices buffer

Definition at line 531 of file map_vector_sparse_cuda_ker.cuh.

◆ init()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::init ( )
inline

This function must be called.

Definition at line 127 of file map_vector_sparse_cuda_ker.cuh.

◆ init_ins_inc()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::init_ins_inc ( )
inline

This function must be called.

Definition at line 143 of file map_vector_sparse_cuda_ker.cuh.

◆ init_rem_inc()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::init_rem_inc ( )
inline

This function must be called.

Definition at line 159 of file map_vector_sparse_cuda_ker.cuh.

◆ insert() [1/2]

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::insert ( Ti  ele) -> decltype(vct_data.template get<p>(0))
inline

It insert an element in the sparse vector.

Definition at line 307 of file map_vector_sparse_cuda_ker.cuh.

◆ insert() [2/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::insert ( Ti  ele) -> decltype(vct_add_data.get(0))
inline

It insert an element in the sparse vector.

Parameters
eleelement to insert
Returns
an object to fill the values

Definition at line 351 of file map_vector_sparse_cuda_ker.cuh.

◆ insert_b() [1/2]

template<typename T, typename Ti, template< typename > class layout_base>
template<unsigned int p>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::insert_b ( Ti  ele,
Ti  slot_base 
) -> decltype(vct_data.template get<p>(0))
inline

It insert an element in the sparse vector.

Definition at line 388 of file map_vector_sparse_cuda_ker.cuh.

◆ insert_b() [2/2]

template<typename T, typename Ti, template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::insert_b ( Ti  ele,
Ti  slot_base 
) -> decltype(vct_add_data.get(0))
inline

It insert an element in the sparse vector.

Definition at line 404 of file map_vector_sparse_cuda_ker.cuh.

◆ remove()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::remove ( Ti  ele)
inline

It insert an element in the sparse vector.

Parameters
eleelement to insert
Returns
an object to fill the values

Definition at line 329 of file map_vector_sparse_cuda_ker.cuh.

◆ remove_b()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ void openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::remove_b ( Ti  ele,
Ti  slot_base 
)
inline

It insert an element in the sparse vector.

Definition at line 371 of file map_vector_sparse_cuda_ker.cuh.

◆ size()

template<typename T, typename Ti, template< typename > class layout_base>
__device__ int openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::size ( )
inline

Get the number of elements.

Returns
the number of elements

Definition at line 119 of file map_vector_sparse_cuda_ker.cuh.


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