18template <
typename scalar_t>
20 const scalar_t* transformation_ptr, scalar_t* points_ptr) {
21 scalar_t x[4] = {transformation_ptr[0] * points_ptr[0] +
22 transformation_ptr[1] * points_ptr[1] +
23 transformation_ptr[2] * points_ptr[2] +
24 transformation_ptr[3],
25 transformation_ptr[4] * points_ptr[0] +
26 transformation_ptr[5] * points_ptr[1] +
27 transformation_ptr[6] * points_ptr[2] +
28 transformation_ptr[7],
29 transformation_ptr[8] * points_ptr[0] +
30 transformation_ptr[9] * points_ptr[1] +
31 transformation_ptr[10] * points_ptr[2] +
32 transformation_ptr[11],
33 transformation_ptr[12] * points_ptr[0] +
34 transformation_ptr[13] * points_ptr[1] +
35 transformation_ptr[14] * points_ptr[2] +
36 transformation_ptr[15]};
38 points_ptr[0] = x[0] / x[3];
39 points_ptr[1] = x[1] / x[3];
40 points_ptr[2] = x[2] / x[3];
43template <
typename scalar_t>
45 const scalar_t* transformation_ptr, scalar_t* normals_ptr) {
46 scalar_t x[3] = {transformation_ptr[0] * normals_ptr[0] +
47 transformation_ptr[1] * normals_ptr[1] +
48 transformation_ptr[2] * normals_ptr[2],
49 transformation_ptr[4] * normals_ptr[0] +
50 transformation_ptr[5] * normals_ptr[1] +
51 transformation_ptr[6] * normals_ptr[2],
52 transformation_ptr[8] * normals_ptr[0] +
53 transformation_ptr[9] * normals_ptr[1] +
54 transformation_ptr[10] * normals_ptr[2]};
56 normals_ptr[0] = x[0];
57 normals_ptr[1] = x[1];
58 normals_ptr[2] = x[2];
61template <
typename scalar_t>
63 const scalar_t* R_ptr, scalar_t* points_ptr,
const scalar_t* center) {
64 scalar_t x[3] = {points_ptr[0] - center[0], points_ptr[1] - center[1],
65 points_ptr[2] - center[2]};
68 R_ptr[0] * x[0] + R_ptr[1] * x[1] + R_ptr[2] * x[2] + center[0];
70 R_ptr[3] * x[0] + R_ptr[4] * x[1] + R_ptr[5] * x[2] + center[1];
72 R_ptr[6] * x[0] + R_ptr[7] * x[1] + R_ptr[8] * x[2] + center[2];
75template <
typename scalar_t>
77 const scalar_t* R_ptr, scalar_t* normals_ptr) {
78 scalar_t x[3] = {R_ptr[0] * normals_ptr[0] + R_ptr[1] * normals_ptr[1] +
79 R_ptr[2] * normals_ptr[2],
80 R_ptr[3] * normals_ptr[0] + R_ptr[4] * normals_ptr[1] +
81 R_ptr[5] * normals_ptr[2],
82 R_ptr[6] * normals_ptr[0] + R_ptr[7] * normals_ptr[1] +
83 R_ptr[8] * normals_ptr[2]};
85 normals_ptr[0] = x[0];
86 normals_ptr[1] = x[1];
87 normals_ptr[2] = x[2];
90#ifndef OPEN3D_SKIP_TRANSFORM_MAIN
93void TransformPointsCUDA
94#elif defined(SYCL_LANGUAGE_VERSION)
95void TransformPointsSYCL
101 scalar_t* points_ptr = points.GetDataPtr<scalar_t>();
102 const scalar_t* transformation_ptr =
103 transformation.GetDataPtr<scalar_t>();
105 core::ParallelFor(transformation.GetDevice(), points.GetLength(),
106 [=] OPEN3D_DEVICE(int64_t workload_idx) {
107 TransformPointsKernel(
109 points_ptr + 3 * workload_idx);
115void TransformNormalsCUDA
116#elif defined(SYCL_LANGUAGE_VERSION)
117void TransformNormalsSYCL
123 scalar_t* normals_ptr = normals.GetDataPtr<scalar_t>();
124 const scalar_t* transformation_ptr =
125 transformation.GetDataPtr<scalar_t>();
127 core::ParallelFor(transformation.GetDevice(), normals.GetLength(),
128 [=] OPEN3D_DEVICE(int64_t workload_idx) {
129 TransformNormalsKernel(
131 normals_ptr + 3 * workload_idx);
138#elif defined(SYCL_LANGUAGE_VERSION)
147 scalar_t* points_ptr = points.GetDataPtr<scalar_t>();
148 const scalar_t* R_ptr = R.GetDataPtr<scalar_t>();
149 const scalar_t* center_ptr = center.GetDataPtr<scalar_t>();
151 core::ParallelFor(R.GetDevice(), points.GetLength(),
152 [=] OPEN3D_DEVICE(int64_t workload_idx) {
153 RotatePointsKernel(R_ptr,
154 points_ptr + 3 * workload_idx,
161void RotateNormalsCUDA
162#elif defined(SYCL_LANGUAGE_VERSION)
163void RotateNormalsSYCL
169 scalar_t* normals_ptr = normals.GetDataPtr<scalar_t>();
170 const scalar_t* R_ptr = R.GetDataPtr<scalar_t>();
172 core::ParallelFor(R.GetDevice(), normals.GetLength(),
173 [=] OPEN3D_DEVICE(int64_t workload_idx) {
175 R_ptr, normals_ptr + 3 * workload_idx);
#define OPEN3D_HOST_DEVICE
Definition CUDAUtils.h:43
#define OPEN3D_FORCE_INLINE
Definition CUDAUtils.h:42
#define DISPATCH_FLOAT_DTYPE_TO_TEMPLATE(DTYPE,...)
Definition Dispatch.h:77
double t
Definition SurfaceReconstructionPoisson.cpp:172
Definition PinholeCameraIntrinsic.cpp:16
const core::Tensor * normals
Definition TriangleMesh.cpp:2126