template<typename T, typename Ti = long int, typename Memory = HeapMemory, typename layout = typename memory_traits_lin<T>::type, template< typename > class layout_base = memory_traits_lin, typename grow_p = grow_policy_double, unsigned int impl = vect_isel<T>::value, unsigned int impl2 = VECTOR_SPARSE_STANDARD, typename block_functor = stub_block_functor>
class openfpm::vector_sparse< T, Ti, Memory, layout, layout_base, grow_p, impl, impl2, block_functor >
Definition at line 788 of file map_vector_sparse.hpp.
|
auto | getIndexBuffer () -> decltype(vct_index)& |
| Get the indices buffer.
|
|
auto | getDataBuffer () -> decltype(vct_data)& |
| Get the data buffer.
|
|
auto | getIndexBuffer () const -> const decltype(vct_index)& |
| Get the indices buffer.
|
|
auto | getDataBuffer () const -> const decltype(vct_data)& |
| Get the data buffer.
|
|
openfpm::sparse_index< Ti > | get_sparse (Ti id) const |
| Get the sparse index.
|
|
template<unsigned int p> |
auto | get (Ti id) const -> decltype(vct_data.template get< p >(id)) |
| Get an element of the vector.
|
|
auto | get (Ti id) const -> decltype(vct_data.get(id)) |
| Get an element of the vector.
|
|
void | resize (size_t n) |
| resize to n elements
|
|
void | swapIndexVector (vector< aggregate< Ti >, Memory, layout_base, grow_p > &iv) |
|
template<unsigned int p> |
auto | getBackground () const -> decltype(vct_data.template get< p >(vct_data.size() -1)) |
| Set the background to bck (which value get must return when the value is not find)
|
|
auto | getBackground () const -> decltype(vct_data.get(vct_data.size() -1)) |
| Set the background to bck (which value get must return when the value is not find)
|
|
template<unsigned int p> |
void | setBackground (const typename boost::mpl::at< typename T::type, boost::mpl::int_< p > >::type &bck_) |
|
template<unsigned int p> |
auto | insert (Ti ele) -> decltype(vct_data.template get< p >(0)) |
| It insert an element in the sparse vector.
|
|
template<unsigned int p> |
auto | insertFlush (Ti ele, bool &is_new) -> decltype(vct_data.template get< p >(0)) |
| It insert an element in the sparse vector.
|
|
auto | insertFlush (Ti ele, bool &is_new) -> decltype(vct_data.get(0)) |
| It insert an element in the sparse vector.
|
|
auto | insert (Ti ele) -> decltype(vct_data.get(0)) |
| It insert an element in the sparse vector.
|
|
template<typename ... v_reduce> |
void | flush_v (vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index_cont_0, gpu::ofp_context_t &context, flush_type opt=FLUSH_ON_HOST, int i=0) |
| merge the added element to the main data array but save the insert buffer in v
|
|
template<typename ... v_reduce> |
void | flush_vd (vector< T, Memory, layout_base, grow_p > &vct_add_data_reord, gpu::ofp_context_t &context, flush_type opt=FLUSH_ON_HOST) |
| merge the added element to the main data array but save the insert buffer in v
|
|
template<typename ... v_reduce> |
void | flush (gpu::ofp_context_t &context, flush_type opt=FLUSH_ON_HOST) |
| merge the added element to the main data array
|
|
void | flush_remove (gpu::ofp_context_t &context, flush_type opt=FLUSH_ON_HOST) |
| merge the added element to the main data array
|
|
size_t | size () |
| Return how many element you have in this map.
|
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > & | private_get_vct_index () |
| Return the sorted vector of the indexes.
|
|
template<unsigned int ... prp> |
void | deviceToHost () |
| Transfer from device to host.
|
|
template<unsigned int ... prp> |
void | hostToDevice () |
| Transfer from host to device.
|
|
vector_sparse_gpu_ker< T, Ti, layout_base > | toKernel () |
| toKernel function transform this structure into one that can be used on GPU
|
|
void | setGPUInsertBuffer (int nblock, int nslot) |
| set the gpu insert buffer for every block
|
|
void | preFlush () |
| In case we manually set the added index buffer and the add data buffer we have to call this function before flush.
|
|
auto | getGPUInsertBuffer () -> decltype(vct_add_data)& |
| Get the GPU insert buffer.
|
|
void | setGPURemoveBuffer (int nblock, int nslot) |
| set the gpu remove buffer for every block
|
|
void | clear () |
| Clear all from all the elements.
|
|
void | swap (vector_sparse< T, Ti, Memory, layout, layout_base, grow_p, impl, impl2, block_functor > &sp) |
|
vector< T, Memory, layout_base, grow_p > & | private_get_vct_add_data () |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > & | private_get_vct_add_index () |
|
const vector< aggregate< Ti >, Memory, layout_base, grow_p > & | private_get_vct_add_index () const |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > & | private_get_vct_nadd_index () |
|
const vector< aggregate< Ti >, Memory, layout_base, grow_p > & | private_get_vct_nadd_index () const |
|
auto | getSegmentToOutMap () -> decltype(blf.get_outputMap()) |
|
auto | getSegmentToOutMap () const -> decltype(blf.get_outputMap()) |
|
void | removeUnusedBuffers () |
| Eliminate many internal temporary buffer you can use this between flushes if you get some out of memory.
|
|
vector< aggregate< Ti, Ti >, Memory, layout_base, grow_p > & | getSegmentToMergeIndexMap () |
|
vector< aggregate< Ti, Ti >, Memory, layout_base, grow_p > & | getSegmentToMergeIndexMap () const |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > & | getMappingVector () |
| Return the mapping vector.
|
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > & | getMergeIndexMapVector () |
| Return the merge mapping vector.
|
|
|
template<bool prefetch> |
Ti | _branchfree_search_nobck (Ti x, Ti &id) const |
| get the element i
|
|
template<bool prefetch> |
void | _branchfree_search (Ti x, Ti &id) const |
| get the element i
|
|
size_t | make_continuos (vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_nadd_index, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_cont_index, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_cont_index_map, vector< T, Memory, layout_base, grow_p > &vct_add_data, vector< T, Memory, layout_base, grow_p > &vct_add_data_cont, gpu::ofp_context_t &context) |
|
void | reorder_indexes (vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_cont_index, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_cont_index_map, vector< T, Memory, layout_base, grow_p > &vct_add_data_reord, vector< T, Memory, layout_base, grow_p > &vct_add_data_cont, gpu::ofp_context_t &context) |
| sort the continuos array of inserted key
|
|
template<typename ... v_reduce> |
void | merge_indexes (vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index_sort, vector< aggregate< Ti, Ti >, Memory, layout_base, grow_p > &vct_add_index_unique, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_merge_index, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_merge_index_map, gpu::ofp_context_t &context) |
| Merge indexes.
|
|
template<typename ... v_reduce> |
void | merge_datas (vector< T, Memory, layout_base, grow_p > &vct_add_data_reord, vector< aggregate< Ti, Ti >, Memory, layout_base, grow_p > &segments_new, vector< T, Memory, layout_base, grow_p > &vct_add_data, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_data_reord_map, gpu::ofp_context_t &context) |
|
template<typename ... v_reduce> |
void | flush_on_gpu_insert (vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index_cont_0, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index_cont_1, vector< T, Memory, layout_base, grow_p > &vct_add_data_reord, gpu::ofp_context_t &context) |
|
void | flush_on_gpu_remove (gpu::ofp_context_t &context) |
|
void | resetBck () |
|
template<typename ... v_reduce> |
void | flush_on_gpu (vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index_cont_0, vector< aggregate< Ti >, Memory, layout_base, grow_p > &vct_add_index_cont_1, vector< T, Memory, layout_base, grow_p > &vct_add_data_reord, gpu::ofp_context_t &context) |
|
template<typename ... v_reduce> |
void | flush_on_cpu () |
|
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_index |
|
vector< T, Memory, layout_base, grow_p, impl > | vct_data |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_m_index |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_add_index |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_rem_index |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_nadd_index |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_nrem_index |
|
vector< T, Memory, layout_base, grow_p > | vct_add_data |
|
vector< T, Memory, layout_base, grow_p > | vct_add_data_reord |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_add_index_cont_0 |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_add_index_cont_1 |
|
vector< T, Memory, layout_base, grow_p > | vct_add_data_cont |
|
vector< aggregate< Ti, Ti >, Memory, layout_base, grow_p > | vct_add_index_unique |
|
vector< aggregate< int, int >, Memory, layout_base, grow_p > | segments_int |
|
vector< T, Memory, layout_base, grow_p, impl > | vct_add_data_unique |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_index_tmp4 |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_index_tmp |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_index_tmp2 |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_index_tmp3 |
|
vector< aggregate< Ti, Ti, Ti >, Memory, layout_base, grow_p > | vct_index_dtmp |
|
vector< aggregate< Ti >, Memory, layout_base, grow_p > | vct_segment_index_map |
|
block_functor | blf |
|
T | bck |
|
CudaMemory | mem |
|
openfpm::vector< reorder< Ti > > | reorder_add_index_cpu |
|
size_t | max_ele |
|
int | n_gpu_add_block_slot = 0 |
|
int | n_gpu_rem_block_slot = 0 |
|
template<typename T , typename Ti = long int, typename Memory = HeapMemory, typename layout = typename memory_traits_lin<T>::type, template< typename > class layout_base = memory_traits_lin, typename grow_p = grow_policy_double, unsigned int impl = vect_isel<T>::value, unsigned int impl2 = VECTOR_SPARSE_STANDARD, typename block_functor = stub_block_functor>
vector< aggregate< Ti >, Memory, layout_base, grow_p > & openfpm::vector_sparse< T, Ti, Memory, layout, layout_base, grow_p, impl, impl2, block_functor >::getMappingVector |
( |
| ) |
|
|
inline |
Return the mapping vector.
When we add new elements this vector contain the merged old elements and new elements position
For example the old vector contain
Old: 5 10 35 50 66 79 (6 elements) New: 7 44 7 9 44 (5 elements) (in order are 7 7 9 44 44)
The merged indexes are (when reordered)
5 7 7 9 10 35 44 44 50 66 79
The returned map contain 5 elements indicating the position of the reordered elements:
0 2 3 1 4 (7)(7)(9)(44)(44)
Definition at line 2081 of file map_vector_sparse.hpp.
template<typename T , typename Ti = long int, typename Memory = HeapMemory, typename layout = typename memory_traits_lin<T>::type, template< typename > class layout_base = memory_traits_lin, typename grow_p = grow_policy_double, unsigned int impl = vect_isel<T>::value, unsigned int impl2 = VECTOR_SPARSE_STANDARD, typename block_functor = stub_block_functor>
vector< aggregate< Ti >, Memory, layout_base, grow_p > & openfpm::vector_sparse< T, Ti, Memory, layout, layout_base, grow_p, impl, impl2, block_functor >::getMergeIndexMapVector |
( |
| ) |
|
|
inline |
Return the merge mapping vector.
When we add new elements this vector contain the merged old elements and new elements position
For example the old vector contain
Old: 5 10 35 50 66 79 (6 elements) New: 7 44 7 9 44 (5 elements) (in order are 7 7 9 44 44)
The merged indexes are (when reordered)
5 7 7 9 10 35 44 44 50 66 79
The returned map contain 5 elements indicating the position of the reordered elements:
0 6 7 8 1 2 9 10 3 4 5 (5)(7)(7)(9)(10)(35)(44)(44)(50)(66)(79)
Definition at line 2104 of file map_vector_sparse.hpp.