#include <Hashmap.h>
|
| Hashmap (int64_t init_capacity, const Dtype &dtype_key, const Dtype &dtype_value, const SizeVector &element_shape_key, const SizeVector &element_shape_value, const Device &device, const HashmapBackend &backend=HashmapBackend::Default) |
|
| ~Hashmap () |
|
void | Rehash (int64_t buckets) |
|
void | Insert (const Tensor &input_keys, const Tensor &input_values, Tensor &output_addrs, Tensor &output_masks) |
|
void | Activate (const Tensor &input_keys, Tensor &output_addrs, Tensor &output_masks) |
|
void | Find (const Tensor &input_keys, Tensor &output_addrs, Tensor &output_masks) |
|
void | Erase (const Tensor &input_keys, Tensor &output_masks) |
|
void | GetActiveIndices (Tensor &output_indices) const |
|
void | Clear () |
| Clear stored map without reallocating memory. More...
|
|
Hashmap | Clone () const |
|
Hashmap | To (const Device &device, bool copy=false) const |
|
Hashmap | CPU () const |
|
Hashmap | CUDA (int device_id=0) const |
|
int64_t | Size () const |
|
int64_t | GetCapacity () const |
|
int64_t | GetBucketCount () const |
|
Device | GetDevice () const |
|
int64_t | GetKeyBytesize () const |
|
int64_t | GetValueBytesize () const |
|
Tensor & | GetKeyBuffer () const |
|
Tensor & | GetValueBuffer () const |
|
Tensor | GetKeyTensor () const |
|
Tensor | GetValueTensor () const |
|
std::vector< int64_t > | BucketSizes () const |
|
float | LoadFactor () const |
| Return size / bucket_count. More...
|
|
std::shared_ptr< DeviceHashmap > | GetDeviceHashmap () const |
|
◆ Hashmap()
Constructor for primitive types, supporting element shapes. Example: Key is int<3> coordinate:
◆ ~Hashmap()
open3d::core::Hashmap::~Hashmap |
( |
| ) |
|
|
inline |
◆ Activate()
void open3d::core::Hashmap::Activate |
( |
const Tensor & |
input_keys, |
|
|
Tensor & |
output_addrs, |
|
|
Tensor & |
output_masks |
|
) |
| |
Parallel activate arrays of keys in Tensor. Specifically useful for large value elements (e.g., a tensor), where we can do in-place management after activation. Return addrs: internal indices that can be directly used for advanced indexing in Tensor key/value buffers. masks: success insertions, must be combined with addrs in advanced indexing.
◆ AssertKeyDtype()
void open3d::core::Hashmap::AssertKeyDtype |
( |
const Dtype & |
dtype_key, |
|
|
const SizeVector & |
elem_shape |
|
) |
| const |
|
protected |
◆ AssertValueDtype()
void open3d::core::Hashmap::AssertValueDtype |
( |
const Dtype & |
dtype_val, |
|
|
const SizeVector & |
elem_shape |
|
) |
| const |
|
protected |
◆ BucketSizes()
std::vector< int64_t > open3d::core::Hashmap::BucketSizes |
( |
| ) |
const |
Return number of elems per bucket. High performance not required, so directly returns a vector.
◆ Clear()
void open3d::core::Hashmap::Clear |
( |
| ) |
|
Clear stored map without reallocating memory.
◆ Clone()
Hashmap open3d::core::Hashmap::Clone |
( |
| ) |
const |
◆ CPU()
Hashmap open3d::core::Hashmap::CPU |
( |
| ) |
const |
◆ CUDA()
Hashmap open3d::core::Hashmap::CUDA |
( |
int |
device_id = 0 | ) |
const |
◆ Erase()
void open3d::core::Hashmap::Erase |
( |
const Tensor & |
input_keys, |
|
|
Tensor & |
output_masks |
|
) |
| |
Parallel erase an array of keys in Tensor. Output masks is a bool Tensor. Return masks: success insertions, must be combined with addrs in advanced indexing.
◆ Find()
void open3d::core::Hashmap::Find |
( |
const Tensor & |
input_keys, |
|
|
Tensor & |
output_addrs, |
|
|
Tensor & |
output_masks |
|
) |
| |
Parallel find an array of keys in Tensor. Return addrs: internal indices that can be directly used for advanced indexing in Tensor key/value buffers. masks: success insertions, must be combined with addrs in advanced indexing.
◆ GetActiveIndices()
void open3d::core::Hashmap::GetActiveIndices |
( |
Tensor & |
output_indices | ) |
const |
Parallel collect all iterators in the hash table Return addrs: internal indices that can be directly used for advanced indexing in Tensor key/value buffers.
◆ GetBucketCount()
int64_t open3d::core::Hashmap::GetBucketCount |
( |
| ) |
const |
◆ GetCapacity()
int64_t open3d::core::Hashmap::GetCapacity |
( |
| ) |
const |
◆ GetDevice()
Device open3d::core::Hashmap::GetDevice |
( |
| ) |
const |
◆ GetDeviceHashmap()
std::shared_ptr<DeviceHashmap> open3d::core::Hashmap::GetDeviceHashmap |
( |
| ) |
const |
|
inline |
◆ GetKeyBuffer()
Tensor & open3d::core::Hashmap::GetKeyBuffer |
( |
| ) |
const |
◆ GetKeyBytesize()
int64_t open3d::core::Hashmap::GetKeyBytesize |
( |
| ) |
const |
◆ GetKeyDtype()
Dtype open3d::core::Hashmap::GetKeyDtype |
( |
| ) |
const |
|
inlineprotected |
◆ GetKeyTensor()
Tensor open3d::core::Hashmap::GetKeyTensor |
( |
| ) |
const |
◆ GetValueBuffer()
Tensor & open3d::core::Hashmap::GetValueBuffer |
( |
| ) |
const |
◆ GetValueBytesize()
int64_t open3d::core::Hashmap::GetValueBytesize |
( |
| ) |
const |
◆ GetValueDtype()
Dtype open3d::core::Hashmap::GetValueDtype |
( |
| ) |
const |
|
inlineprotected |
◆ GetValueTensor()
Tensor open3d::core::Hashmap::GetValueTensor |
( |
| ) |
const |
◆ Insert()
void open3d::core::Hashmap::Insert |
( |
const Tensor & |
input_keys, |
|
|
const Tensor & |
input_values, |
|
|
Tensor & |
output_addrs, |
|
|
Tensor & |
output_masks |
|
) |
| |
Parallel insert arrays of keys and values in Tensors. Return addrs: internal indices that can be directly used for advanced indexing in Tensor key/value buffers. masks: success insertions, must be combined with addrs in advanced indexing.
◆ LoadFactor()
float open3d::core::Hashmap::LoadFactor |
( |
| ) |
const |
Return size / bucket_count.
◆ Rehash()
void open3d::core::Hashmap::Rehash |
( |
int64_t |
buckets | ) |
|
Rehash expects extra memory space at runtime, since it consists of 1) dumping all key value pairs to a buffer 2) deallocate old hash table 3) create a new hash table 4) parallel insert dumped key value pairs
◆ Size()
int64_t open3d::core::Hashmap::Size |
( |
| ) |
const |
◆ To()
Hashmap open3d::core::Hashmap::To |
( |
const Device & |
device, |
|
|
bool |
copy = false |
|
) |
| const |
The documentation for this class was generated from the following files: