24 #ifdef BUILD_CUDA_MODULE
25 void CUDAResetHeap(Tensor &heap);
50 std::atomic<int>
cpu = {0};
55 std::vector<int64_t> value_dsizes,
int64_t GetKeyDsize() const
Return key's data size in bytes.
std::vector< Tensor > value_buffers_
Tensor GetKeyBuffer() const
Return the key buffer tensor.
HashBackendBuffer(int64_t capacity, int64_t key_dsize, std::vector< int64_t > value_dsizes, const Device &device)
Device GetDevice() const
Return device of the buffer.
int GetHeapTopIndex() const
Return the current heap top.
std::vector< int64_t > GetValueDsizes() const
Return value's data sizes in bytes.
std::vector< int64_t > GetValueBlocksPerElement() const
Return value's data sizes in the unit of common block size divisor.
Tensor GetValueBuffer(size_t i=0) const
Return the selected value buffer tensor at index i.
int64_t GetCommonBlockSize() const
Get the common block size divisor of all values types.
int64_t common_block_size_
std::vector< Tensor > GetValueBuffers() const
Return the value buffer tensors.
std::vector< int64_t > blocks_per_element_
int64_t GetCapacity() const
Return capacity of the buffer.
void ResetHeap()
Reset the heap and heap top.
Tensor GetIndexHeap() const
Return the index heap tensor.
void CPUResetHeap(Tensor &heap)
Generic file read and write utility for python interface.