LSLab
Public Types | Public Member Functions | List of all members
lslab::map< K, V, Allocator, Hash > Class Template Reference

lslab map for GPU More...

#include <map.h>

Public Types

using this_t = map< K, V, Allocator, Hash >
 
using this_t = map< K, V, Allocator, Hash >
 

Public Member Functions

LSLAB_HOST map (unsigned n_log_2)
 
LSLAB_HOST map (unsigned n_log_2, Allocator &&a)
 
LSLAB_HOST_DEVICE map (warp_mutex *lt, detail::slab_node< K, V > *s, unsigned n_log_2)
 
LSLAB_DEVICE map (warp_mutex *lt, detail::slab_node< K, V > *s, unsigned n_log_2, Allocator &&a)
 
template<typename Fn >
LSLAB_DEVICE void find_function (const K &key, Fn &&fn, bool thread_mask=true)
 
LSLAB_DEVICE bool get (const K &key, V &value, bool thread_mask=true)
 
template<typename Fn >
LSLAB_DEVICE void insert_function (const K &key, Fn &&fn, bool thread_mask=true)
 
LSLAB_DEVICE V put (const K &key, const V &value, bool thread_mask=true)
 
template<typename Fn >
LSLAB_DEVICE bool update_function (const K &key, Fn &&fn, bool thread_mask=true)
 
LSLAB_DEVICE cuda::std::pair< bool, V > update (const K &key, const V &value, bool thread_mask=true)
 
template<int block_size = 256>
LSLAB_HOST void put (cuda::std::pair< K, V > *operations, V *output, size_t size, cudaStream_t stream=0x0)
 
template<int block_size = 256>
LSLAB_HOST void put (K *operations_keys, V *operations_values, V *output, size_t size, cudaStream_t stream=0x0)
 
template<int block_size = 256>
LSLAB_HOST void get (K *operations, cuda::std::pair< bool, V > *output, size_t size, cudaStream_t stream=0x0)
 
template<int block_size = 256>
LSLAB_HOST void update (cuda::std::pair< K, V > *operations, cuda::std::pair< bool, V > *output, size_t size, cudaStream_t stream=0x0)
 
LSLAB_HOST_DEVICE unsigned buckets ()
 
LSLAB_HOST map ()
 create new map
 
LSLAB_HOST map (unsigned n_log_2)
 create new map
 
LSLAB_HOST map (unsigned n_log_2, Allocator &&a)
 create new map
 
LSLAB_HOST_DEVICE map (warp_mutex *lt, detail::slab_node< K, V > *s, unsigned n_log_2)
 create new map
 
LSLAB_DEVICE map (warp_mutex *lt, detail::slab_node< K, V > *s, unsigned n_log_2, Allocator &&a)
 create new map
 
LSLAB_HOST_DEVICE ~map ()
 destruct map
 
template<typename Fn >
LSLAB_DEVICE void find_function (const K &key, Fn &&fn, bool thread_mask=true)
 use function fn after searching for the given key More...
 
LSLAB_DEVICE bool get (const K &key, V &value, bool thread_mask=true)
 get the value at key More...
 
template<typename Fn >
LSLAB_DEVICE void insert_function (const K &key, Fn &&fn, bool thread_mask=true)
 use function fn when inserting the given key More...
 
LSLAB_DEVICE V put (const K &key, const V &value, bool thread_mask=true)
 puts the key value pair in the map
 
template<typename Fn >
LSLAB_DEVICE bool update_function (const K &key, Fn &&fn, bool thread_mask=true)
 use function fn when updating the given key More...
 
LSLAB_DEVICE cuda::std::pair< bool, V > update (const K &key, const V &value, bool thread_mask=true)
 update the key with the value More...
 
template<int block_size = 256>
LSLAB_HOST void put (cuda::std::pair< K, V > *operations, V *output, size_t size, cudaStream_t stream=0x0)
 Do a batch of put operations. More...
 
template<int block_size = 256>
LSLAB_HOST void put (K *operations_keys, V *operations_values, V *output, size_t size, cudaStream_t stream=0x0)
 Do a batch of put operations. More...
 
template<int block_size = 256>
LSLAB_HOST void get (K *operations, cuda::std::pair< bool, V > *output, size_t size, cudaStream_t stream=0x0)
 Do a batch of get operations. More...
 
template<int block_size = 256>
LSLAB_HOST void update (cuda::std::pair< K, V > *operations, cuda::std::pair< bool, V > *output, size_t size, cudaStream_t stream=0x0)
 Do a batch of updates. More...
 
LSLAB_HOST_DEVICE unsigned buckets ()
 get number of buckets
 

Detailed Description

template<typename K, typename V, typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
class lslab::map< K, V, Allocator, Hash >

lslab map for GPU

LSlab map for GPU

Template Parameters
Kkey type
Vvalue type
Allocatorallocator type
Hashhash function type

Member Typedef Documentation

◆ this_t

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
using lslab::map< K, V, Allocator, Hash >::this_t = map<K, V, Allocator, Hash>

@breif this type

Member Function Documentation

◆ find_function()

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<typename Fn >
LSLAB_DEVICE void lslab::map< K, V, Allocator, Hash >::find_function ( const K &  key,
Fn &&  fn,
bool  thread_mask = true 
)
inline

use function fn after searching for the given key

Template Parameters
Fnfunction type

◆ get() [1/2]

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
LSLAB_DEVICE bool lslab::map< K, V, Allocator, Hash >::get ( const K &  key,
V &  value,
bool  thread_mask = true 
)
inline

get the value at key

Returns
returns if found

◆ get() [2/2]

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<int block_size = 256>
LSLAB_HOST void lslab::map< K, V, Allocator, Hash >::get ( K *  operations,
cuda::std::pair< bool, V > *  output,
size_t  size,
cudaStream_t  stream = 0x0 
)
inline

Do a batch of get operations.

Template Parameters
block_sizesize of CTA on GPU

◆ insert_function()

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<typename Fn >
LSLAB_DEVICE void lslab::map< K, V, Allocator, Hash >::insert_function ( const K &  key,
Fn &&  fn,
bool  thread_mask = true 
)
inline

use function fn when inserting the given key

Template Parameters
Fnfunction type

◆ put() [1/2]

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<int block_size = 256>
LSLAB_HOST void lslab::map< K, V, Allocator, Hash >::put ( cuda::std::pair< K, V > *  operations,
V *  output,
size_t  size,
cudaStream_t  stream = 0x0 
)
inline

Do a batch of put operations.

Template Parameters
block_sizesize of CTA on GPU

◆ put() [2/2]

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<int block_size = 256>
LSLAB_HOST void lslab::map< K, V, Allocator, Hash >::put ( K *  operations_keys,
V *  operations_values,
V *  output,
size_t  size,
cudaStream_t  stream = 0x0 
)
inline

Do a batch of put operations.

Template Parameters
block_sizesize of CTA on GPU

◆ update() [1/2]

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
LSLAB_DEVICE cuda::std::pair<bool, V> lslab::map< K, V, Allocator, Hash >::update ( const K &  key,
const V &  value,
bool  thread_mask = true 
)
inline

update the key with the value

Returns
prior value

◆ update() [2/2]

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<int block_size = 256>
LSLAB_HOST void lslab::map< K, V, Allocator, Hash >::update ( cuda::std::pair< K, V > *  operations,
cuda::std::pair< bool, V > *  output,
size_t  size,
cudaStream_t  stream = 0x0 
)
inline

Do a batch of updates.

Template Parameters
block_sizesize of CTA on GPU

◆ update_function()

template<typename K , typename V , typename Allocator = device_allocator<detail::slab_node<K, V>>, typename Hash = hash<K>>
template<typename Fn >
LSLAB_DEVICE bool lslab::map< K, V, Allocator, Hash >::update_function ( const K &  key,
Fn &&  fn,
bool  thread_mask = true 
)
inline

use function fn when updating the given key

Template Parameters
Fnfunction type

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