14 #define INSTANTIATE_TYPES(DTYPE, DIM) \
15 using key_t = utility::MiniVec<DTYPE, DIM>; \
16 using hash_t = utility::MiniVecHash<DTYPE, DIM>; \
17 using eq_t = utility::MiniVecEq<DTYPE, DIM>;
19 #define DIM_SWITCHER(DTYPE, DIM, ...) \
21 INSTANTIATE_TYPES(DTYPE, 1) \
22 return __VA_ARGS__(); \
23 } else if (DIM == 2) { \
24 INSTANTIATE_TYPES(DTYPE, 2) \
25 return __VA_ARGS__(); \
26 } else if (DIM == 3) { \
27 INSTANTIATE_TYPES(DTYPE, 3) \
28 return __VA_ARGS__(); \
29 } else if (DIM == 4) { \
30 INSTANTIATE_TYPES(DTYPE, 4) \
31 return __VA_ARGS__(); \
32 } else if (DIM == 5) { \
33 INSTANTIATE_TYPES(DTYPE, 5) \
34 return __VA_ARGS__(); \
35 } else if (DIM == 6) { \
36 INSTANTIATE_TYPES(DTYPE, 6) \
37 return __VA_ARGS__(); \
40 "Unsupported dim {}, please modify {} and compile from " \
46 #define DISPATCH_DTYPE_AND_DIM_TO_TEMPLATE(DTYPE, DIM, ...) \
48 if (DTYPE == open3d::core::Int64) { \
49 DIM_SWITCHER(int64_t, DIM, __VA_ARGS__) \
50 } else if (DTYPE == open3d::core::Int32) { \
51 DIM_SWITCHER(int, DIM, __VA_ARGS__) \
52 } else if (DTYPE == open3d::core::Int16) { \
53 DIM_SWITCHER(short, DIM, __VA_ARGS__) \
56 "Unsupported dtype {}, please use integer types (Int64, " \
66 #define DISPATCH_DIVISOR_SIZE_TO_BLOCK_T(DIVISOR, ...) \
68 if (DIVISOR == 16) { \
69 using block_t = int4; \
70 return __VA_ARGS__(); \
71 } else if (DIVISOR == 12) { \
72 using block_t = int3; \
73 return __VA_ARGS__(); \
74 } else if (DIVISOR == 8) { \
75 using block_t = int2; \
76 return __VA_ARGS__(); \
77 } else if (DIVISOR == 4) { \
78 using block_t = int; \
79 return __VA_ARGS__(); \
80 } else if (DIVISOR == 2) { \
81 using block_t = int16_t; \
82 return __VA_ARGS__(); \
84 using block_t = uint8_t; \
85 return __VA_ARGS__(); \
93 template <
typename T,
int N>
97 uint64_t hash = UINT64_C(14695981039346656037);
98 #if defined(__CUDA_ARCH__)
101 for (
int i = 0; i < N; ++i) {
102 hash ^=
static_cast<uint64_t>(key[i]);
103 hash *= UINT64_C(1099511628211);
109 template <
typename T,
int N>
114 bool is_equal =
true;
115 #if defined(__CUDA_ARCH__)
118 for (
int i = 0; i < N; ++i) {
119 is_equal = is_equal && (lhs[i] == rhs[i]);
#define OPEN3D_HOST_DEVICE
Definition: CUDAUtils.h:44
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:343
Definition: PinholeCameraIntrinsic.cpp:16
Definition: Dispatch.h:110
OPEN3D_HOST_DEVICE bool operator()(const MiniVec< T, N > &lhs, const MiniVec< T, N > &rhs) const
Definition: Dispatch.h:112
Definition: Dispatch.h:94
OPEN3D_HOST_DEVICE uint64_t operator()(const MiniVec< T, N > &key) const
Definition: Dispatch.h:96