1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
9 #include <cuda_runtime.h>
11 #include "cloudViewer/t/pipelines/kernel/TransformationConverterImpl.h"
13 namespace cloudViewer {
18 template <typename scalar_t>
19 __global__ void PoseToTransformationKernel(scalar_t *transformation_ptr,
20 const scalar_t *X_ptr) {
21 PoseToTransformationImpl(transformation_ptr, X_ptr);
24 template <typename scalar_t>
25 void PoseToTransformationCUDA(scalar_t *transformation_ptr,
26 const scalar_t *X_ptr) {
27 utility::LogError("Unsupported data type.");
31 void PoseToTransformationCUDA<float>(float *transformation_ptr,
33 PoseToTransformationKernel<float>
34 <<<1, 1, 0, core::cuda::GetStream()>>>(transformation_ptr, X_ptr);
38 void PoseToTransformationCUDA<double>(double *transformation_ptr,
39 const double *X_ptr) {
40 PoseToTransformationKernel<double>
41 <<<1, 1, 0, core::cuda::GetStream()>>>(transformation_ptr, X_ptr);
44 template <typename scalar_t>
45 __global__ void TransformationToPoseKernel(scalar_t *X_ptr,
46 const scalar_t *transformation_ptr) {
47 TransformationToPoseImpl(X_ptr, transformation_ptr);
50 template <typename scalar_t>
51 void TransformationToPoseCUDA(scalar_t *X_ptr,
52 const scalar_t *transformation_ptr) {
53 utility::LogError("Unsupported data type.");
57 void TransformationToPoseCUDA<float>(float *X_ptr,
58 const float *transformation_ptr) {
59 TransformationToPoseKernel<float>
60 <<<1, 1, 0, core::cuda::GetStream()>>>(X_ptr, transformation_ptr);
64 void TransformationToPoseCUDA<double>(double *X_ptr,
65 const double *transformation_ptr) {
66 TransformationToPoseKernel<double>
67 <<<1, 1, 0, core::cuda::GetStream()>>>(X_ptr, transformation_ptr);
71 } // namespace pipelines
73 } // namespace cloudViewer