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::TBBHashmap< Key, Hash > Class Template Reference

#include <TBBHashmap.h>

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

Public Member Functions

 TBBHashmap (int64_t init_capacity, int64_t dsize_key, int64_t dsize_value, const Device &device)
 
 ~TBBHashmap ()
 
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
 
std::shared_ptr< tbb::concurrent_unordered_map< Key, addr_t, Hash > > GetImpl () const
 
- 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 capacity)
 

Protected Attributes

std::shared_ptr< tbb::concurrent_unordered_map< Key, addr_t, Hash > > impl_
 
std::shared_ptr< CPUHashmapBufferAccessorbuffer_ctx_
 

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

◆ TBBHashmap()

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

◆ ~TBBHashmap()

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

Member Function Documentation

◆ Activate()

template<typename Key , typename Hash >
void open3d::core::TBBHashmap< 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::TBBHashmap< Key, Hash >::Allocate ( int64_t  capacity)
protected

◆ BucketSizes()

template<typename Key , typename Hash >
std::vector< int64_t > open3d::core::TBBHashmap< 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::TBBHashmap< Key, Hash >::Clear ( )
overridevirtual

Clear stored map without reallocating memory.

Implements open3d::core::DeviceHashmap.

◆ Erase()

template<typename Key , typename Hash >
void open3d::core::TBBHashmap< 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::TBBHashmap< 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.

◆ GetActiveIndices()

template<typename Key , typename Hash >
int64_t open3d::core::TBBHashmap< 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::TBBHashmap< Key, Hash >::GetBucketCount ( ) const
overridevirtual

◆ GetImpl()

template<typename Key , typename Hash >
std::shared_ptr<tbb::concurrent_unordered_map<Key, addr_t, Hash> > open3d::core::TBBHashmap< Key, Hash >::GetImpl ( ) const
inline

◆ Insert()

template<typename Key , typename Hash >
void open3d::core::TBBHashmap< 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::TBBHashmap< Key, Hash >::InsertImpl ( const void *  input_keys,
const void *  input_values,
addr_t output_addrs,
bool *  output_masks,
int64_t  count 
)
protected

◆ LoadFactor()

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

◆ Rehash()

template<typename Key , typename Hash >
void open3d::core::TBBHashmap< 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::TBBHashmap< Key, Hash >::Size ( ) const
overridevirtual

Field Documentation

◆ buffer_ctx_

template<typename Key , typename Hash >
std::shared_ptr<CPUHashmapBufferAccessor> open3d::core::TBBHashmap< Key, Hash >::buffer_ctx_
protected

◆ impl_

template<typename Key , typename Hash >
std::shared_ptr<tbb::concurrent_unordered_map<Key, addr_t, Hash> > open3d::core::TBBHashmap< Key, Hash >::impl_
protected

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