11#ifndef CUBBYFLOW_CUDA_POINT_HASH_GRID_SEARCHER2_HPP
12#define CUBBYFLOW_CUDA_POINT_HASH_GRID_SEARCHER2_HPP
14#ifdef CUBBYFLOW_USE_CUDA
19#include <cuda_runtime.h>
38 HashUtils() =
default;
40 inline CUBBYFLOW_CUDA_HOST_DEVICE HashUtils(
float gridSpacing,
43 inline CUBBYFLOW_CUDA_HOST_DEVICE
void GetNearbyKeys(
44 float2 position, uint32_t* nearbyKeys)
const;
46 inline CUBBYFLOW_CUDA_HOST_DEVICE int2
47 GetBucketIndex(float2 position)
const;
49 inline CUBBYFLOW_CUDA_HOST_DEVICE uint32_t
50 GetHashKeyFromBucketIndex(int2 bucketIndex)
const;
52 inline CUBBYFLOW_CUDA_HOST_DEVICE uint32_t
53 GetHashKeyFromPosition(float2 position)
const;
61 template <
typename Callback>
62 class ForEachNearbyPointFunc
65 inline CUBBYFLOW_CUDA_HOST_DEVICE ForEachNearbyPointFunc(
66 float r,
float gridSpacing, uint2 resolution,
const uint32_t* sit,
67 const uint32_t* eit,
const uint32_t* si,
const float2* p,
68 const float2* o, Callback cb);
70 template <
typename Index>
71 inline CUBBYFLOW_CUDA_HOST_DEVICE
void operator()(Index idx);
74 HashUtils m_hashUtils;
76 const uint32_t* m_startIndexTable;
77 const uint32_t* m_endIndexTable;
78 const uint32_t* m_sortedIndices;
79 const float2* m_points;
80 const float2* m_origins;
144 template <
typename Callback>
148 float GridSpacing()
const;
230 static Builder GetBuilder();
233 float m_gridSpacing = 1.0f;
245 std::shared_ptr<CUDAPointHashGridSearcher2>;
251class CUDAPointHashGridSearcher2::Builder
final
255 Builder& WithResolution(
const Vector2UZ& resolution);
258 Builder& WithGridSpacing(
float gridSpacing);
261 CUDAPointHashGridSearcher2 Build()
const;
264 CUDAPointHashGridSearcher2Ptr MakeShared()
const;
268 float m_gridSpacing = 1.0f;
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
Vector2< size_t > Vector2UZ
Definition Matrix.hpp:776