ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CPUHashBackendBuffer.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <Parallel.h>
9 
11 
12 namespace cloudViewer {
13 namespace core {
14 void CPUResetHeap(Tensor& heap) {
15  uint32_t* heap_ptr = heap.GetDataPtr<uint32_t>();
16  int64_t capacity = heap.GetLength();
17 
18 #pragma omp parallel for num_threads(utility::EstimateMaxThreads())
19  for (int64_t i = 0; i < capacity; ++i) {
20  heap_ptr[i] = i;
21  }
22 };
23 } // namespace core
24 } // namespace cloudViewer
int64_t GetLength() const
Definition: Tensor.h:1125
void CPUResetHeap(Tensor &heap)
Generic file read and write utility for python interface.