OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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 46 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.
 
__device__ void init ()
 This function must be called.
 
__device__ void init_ins_inc ()
 This function must be called.
 
__device__ void init_rem_inc ()
 This function must be called.
 
__device__ openfpm::sparse_index< Ti > get_sparse (Ti id) const
 Get the sparse index.
 
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.
 
__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.
 
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.
 
__device__ Ti get_index (openfpm::sparse_index< Ti > id) const
 Get the index associated to the element id.
 
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.
 
template<unsigned int p>
__device__ auto get_ele (Ti di) const -> decltype(vct_data.template get< p >(di))
 Get an element of the vector.
 
template<unsigned int p>
__device__ auto insert (Ti ele) -> decltype(vct_data.template get< p >(0))
 It insert an element in the sparse vector.
 
__device__ void remove (Ti ele)
 It insert an element in the sparse vector.
 
__device__ auto insert (Ti ele) -> decltype(vct_add_data.get(0))
 It insert an element in the sparse vector.
 
__device__ void remove_b (Ti ele, Ti slot_base)
 It insert an element in the sparse vector.
 
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.
 
__device__ auto insert_b (Ti ele, Ti slot_base) -> decltype(vct_add_data.get(0))
 It insert an element in the sparse vector.
 
__device__ void flush_block_insert ()
 It insert an element in the sparse vector.
 
__device__ void flush_block_remove ()
 It insert an element in the sparse vector.
 
auto & private_get_vct_nadd_index ()
 
__device__ void flush_block_insert (Ti b, bool flusher)
 It insert an element in the sparse vector.
 
__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.
 
__device__ auto getAddDataBuffer () -> decltype(vct_add_data)&
 Get the data buffer.
 
__device__ auto getDataBuffer () -> decltype(vct_data)&
 Get the data buffer.
 
__device__ auto getAddIndexBuffer () const -> const decltype(vct_add_index)&
 Get the indices buffer.
 
__device__ auto getIndexBuffer () const -> const decltype(vct_index)&
 Get the indices buffer.
 
__device__ auto getDataBuffer () const -> const decltype(vct_data)&
 Get the data buffer.
 

Private Member Functions

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

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 Typedef Documentation

◆ index_type

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

Definition at line 96 of file map_vector_sparse_cuda_ker.cuh.

◆ yes_has_check_device_pointer

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

Indicate this structure has a function to check the device pointer.

Definition at line 99 of file map_vector_sparse_cuda_ker.cuh.

Constructor & Destructor Documentation

◆ vector_sparse_gpu_ker()

template<typename T , typename Ti , template< typename > class layout_base>
openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::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 
)
inline

Definition at line 101 of file map_vector_sparse_cuda_ker.cuh.

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 75 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 424 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 471 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 445 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 495 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [1/5]

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 255 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [2/5]

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 239 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [3/5]

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

Definition at line 221 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [4/5]

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 214 of file map_vector_sparse_cuda_ker.cuh.

◆ get() [5/5]

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 282 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 299 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 266 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 185 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 513 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 531 of file map_vector_sparse_cuda_ker.cuh.

◆ getBackground()

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 >::getBackground ( ) const -> decltype(vct_data.template get<p>(0)) &
inline

Get the background value.

Definition at line 198 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 522 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 549 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 540 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 129 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 145 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 161 of file map_vector_sparse_cuda_ker.cuh.

◆ insert() [1/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 355 of file map_vector_sparse_cuda_ker.cuh.

◆ insert() [2/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 309 of file map_vector_sparse_cuda_ker.cuh.

◆ insert_b() [1/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 408 of file map_vector_sparse_cuda_ker.cuh.

◆ insert_b() [2/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 392 of file map_vector_sparse_cuda_ker.cuh.

◆ private_get_data()

template<typename T , typename Ti , template< typename > class layout_base>
__device__ auto openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::private_get_data ( ) -> decltype(vct_add_data.getBase().get_data_())
inline

Definition at line 486 of file map_vector_sparse_cuda_ker.cuh.

◆ private_get_vct_nadd_index()

template<typename T , typename Ti , template< typename > class layout_base>
auto & openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::private_get_vct_nadd_index ( )
inline

Definition at line 462 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 333 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 375 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 121 of file map_vector_sparse_cuda_ker.cuh.

Field Documentation

◆ nslot_add

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

Definition at line 66 of file map_vector_sparse_cuda_ker.cuh.

◆ nslot_rem

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

Definition at line 67 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_add_data

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

Definition at line 60 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_add_index

template<typename T , typename Ti , template< typename > class layout_base>
vector_gpu_ker<aggregate<Ti>,layout_base> openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::vct_add_index
private

Definition at line 52 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_data

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

Definition at line 50 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_index

template<typename T , typename Ti , template< typename > class layout_base>
vector_gpu_ker<aggregate<Ti>,layout_base> openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::vct_index
private

Definition at line 48 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_nadd_index

template<typename T , typename Ti , template< typename > class layout_base>
vector_gpu_ker<aggregate<Ti>,layout_base> openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::vct_nadd_index
private

Definition at line 56 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_nrem_index

template<typename T , typename Ti , template< typename > class layout_base>
vector_gpu_ker<aggregate<Ti>,layout_base> openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::vct_nrem_index
private

Definition at line 58 of file map_vector_sparse_cuda_ker.cuh.

◆ vct_rem_index

template<typename T , typename Ti , template< typename > class layout_base>
vector_gpu_ker<aggregate<Ti>,layout_base> openfpm::vector_sparse_gpu_ker< T, Ti, layout_base >::vct_rem_index
private

Definition at line 54 of file map_vector_sparse_cuda_ker.cuh.


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