Open3D (C++ API)  0.13.0
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes
open3d::core::SlabHashmap< Key, Hash > Class Template Reference

#include <SlabHashmap.h>

Inheritance diagram for open3d::core::SlabHashmap< Key, Hash >:
open3d::core::DeviceHashmap

Public Member Functions

 SlabHashmap (int64_t init_capacity, int64_t dsize_key, int64_t dsize_value, const Device &device)
 
 ~SlabHashmap ()
 
void Rehash (int64_t buckets) override
 
void Insert (const void *input_keys, const void *input_values, addr_t *output_addrs, bool *output_masks, int64_t count) override
 Parallel insert contiguous arrays of keys and values. More...
 
void Activate (const void *input_keys, addr_t *output_addrs, bool *output_masks, int64_t count) override
 
void Find (const void *input_keys, addr_t *output_addrs, bool *output_masks, int64_t count) override
 Parallel find a contiguous array of keys. More...
 
void Erase (const void *input_keys, bool *output_masks, int64_t count) override
 Parallel erase a contiguous array of keys. More...
 
int64_t GetActiveIndices (addr_t *output_indices) override
 Parallel collect all iterators in the hash table. More...
 
void Clear () override
 Clear stored map without reallocating memory. More...
 
int64_t Size () const override
 
int64_t GetBucketCount () const override
 
std::vector< int64_t > BucketSizes () const override
 
float LoadFactor () const override
 
SlabHashmapImpl< Key, Hash > GetImpl ()
 
- Public Member Functions inherited from open3d::core::DeviceHashmap
 DeviceHashmap (int64_t init_capacity, int64_t dsize_key, int64_t dsize_value, const Device &device)
 Comprehensive constructor for the developer. More...
 
virtual ~DeviceHashmap ()
 
int64_t GetCapacity () const
 
int64_t GetKeyBytesize () const
 
int64_t GetValueBytesize () const
 
Device GetDevice () const
 
TensorGetKeyBuffer ()
 
TensorGetValueBuffer ()
 

Protected Member Functions

void InsertImpl (const void *input_keys, const void *input_values, addr_t *output_addrs, bool *output_masks, int64_t count)
 
void Allocate (int64_t bucket_count, int64_t capacity)
 
void Free ()
 

Protected Attributes

SlabHashmapImpl< Key, Hash > impl_
 
CUDAHashmapBufferAccessor buffer_accessor_
 
std::shared_ptr< SlabNodeManagernode_mgr_
 
int64_t bucket_count_
 

Additional Inherited Members

- Data Fields inherited from open3d::core::DeviceHashmap
int64_t capacity_
 
int64_t dsize_key_
 
int64_t dsize_value_
 
Device device_
 
std::shared_ptr< HashmapBufferbuffer_
 

Constructor & Destructor Documentation

◆ SlabHashmap()

template<typename Key , typename Hash >
open3d::core::SlabHashmap< Key, Hash >::SlabHashmap ( int64_t  init_capacity,
int64_t  dsize_key,
int64_t  dsize_value,
const Device device 
)

◆ ~SlabHashmap()

template<typename Key , typename Hash >
open3d::core::SlabHashmap< Key, Hash >::~SlabHashmap ( )

Member Function Documentation

◆ Activate()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Activate ( const void *  input_keys,
addr_t output_iterators,
bool *  output_masks,
int64_t  count 
)
overridevirtual

Parallel activate contiguous arrays of keys without copying values. Specifically useful for large value elements (e.g., a tensor), where we can do in-place management after activation.

Implements open3d::core::DeviceHashmap.

◆ Allocate()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Allocate ( int64_t  bucket_count,
int64_t  capacity 
)
protected

◆ BucketSizes()

template<typename Key , typename Hash >
std::vector< int64_t > open3d::core::SlabHashmap< Key, Hash >::BucketSizes ( ) const
overridevirtual

Return number of elems per bucket. High performance not required, so directly returns a vector.

Implements open3d::core::DeviceHashmap.

◆ Clear()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Clear ( )
overridevirtual

Clear stored map without reallocating memory.

Implements open3d::core::DeviceHashmap.

◆ Erase()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Erase ( const void *  input_keys,
bool *  output_masks,
int64_t  count 
)
overridevirtual

Parallel erase a contiguous array of keys.

Implements open3d::core::DeviceHashmap.

◆ Find()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Find ( const void *  input_keys,
addr_t output_iterators,
bool *  output_masks,
int64_t  count 
)
overridevirtual

Parallel find a contiguous array of keys.

Implements open3d::core::DeviceHashmap.

◆ Free()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Free ( )
protected

◆ GetActiveIndices()

template<typename Key , typename Hash >
int64_t open3d::core::SlabHashmap< Key, Hash >::GetActiveIndices ( addr_t output_indices)
overridevirtual

Parallel collect all iterators in the hash table.

Implements open3d::core::DeviceHashmap.

◆ GetBucketCount()

template<typename Key , typename Hash >
int64_t open3d::core::SlabHashmap< Key, Hash >::GetBucketCount ( ) const
overridevirtual

◆ GetImpl()

template<typename Key , typename Hash >
SlabHashmapImpl<Key, Hash> open3d::core::SlabHashmap< Key, Hash >::GetImpl ( )
inline

◆ Insert()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Insert ( const void *  input_keys,
const void *  input_values,
addr_t output_iterators,
bool *  output_masks,
int64_t  count 
)
overridevirtual

Parallel insert contiguous arrays of keys and values.

Implements open3d::core::DeviceHashmap.

◆ InsertImpl()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::InsertImpl ( const void *  input_keys,
const void *  input_values,
addr_t output_addrs,
bool *  output_masks,
int64_t  count 
)
protected

Rehash, Insert, Activate all call InsertImpl. It will be clean to separate this implementation and avoid shared checks.

Increase heap_counter to pre-allocate potential memory increment and avoid atomicAdd in kernel.

◆ LoadFactor()

template<typename Key , typename Hash >
float open3d::core::SlabHashmap< Key, Hash >::LoadFactor ( ) const
overridevirtual

◆ Rehash()

template<typename Key , typename Hash >
void open3d::core::SlabHashmap< Key, Hash >::Rehash ( int64_t  buckets)
overridevirtual

Rehash expects a lot of extra memory space at runtime, since it consists of 1) dumping all key value pairs to a buffer 2) creating a new hash table 3) parallel inserting dumped key value pairs 4) deallocating old hash table

Implements open3d::core::DeviceHashmap.

◆ Size()

template<typename Key , typename Hash >
int64_t open3d::core::SlabHashmap< Key, Hash >::Size ( ) const
overridevirtual

Field Documentation

◆ bucket_count_

template<typename Key , typename Hash >
int64_t open3d::core::SlabHashmap< Key, Hash >::bucket_count_
protected

◆ buffer_accessor_

template<typename Key , typename Hash >
CUDAHashmapBufferAccessor open3d::core::SlabHashmap< Key, Hash >::buffer_accessor_
protected

◆ impl_

template<typename Key , typename Hash >
SlabHashmapImpl<Key, Hash> open3d::core::SlabHashmap< Key, Hash >::impl_
protected

The struct is directly passed to kernels by value, so cannot be a shared pointer.

◆ node_mgr_

template<typename Key , typename Hash >
std::shared_ptr<SlabNodeManager> open3d::core::SlabHashmap< Key, Hash >::node_mgr_
protected

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